-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API: raise an exception when adding a multi-dimensional column as an index #16360
base: main
Are you sure you want to change the base?
API: raise an exception when adding a multi-dimensional column as an index #16360
Conversation
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
👋 Thank you for your draft pull request! Do you know that you can use |
9d6c260
to
63d771b
Compare
This stops the crash but I'm not sure it is creating a functional index. This snippet sets up the data like in the test (but as np.ma.array not MaskedColumn) and then runs some of the index code near the patch. The outputs don't entirely make sense to me.
|
Even for the unmasked case I don't think a multi-dim column can be used for the index. When I tried, the index gets created but it seems nonsensical and I could not use it via |
Indeed, my patch makes the behavior consistent between masked and unmasked multi-dim indexes, so if the result is nonsensical in one case, it must be the case for the other one too ! I'll admit I didn't pay attention to anything other than consistency since the report was specifically about the masked case and my brain quickly overheats from multi-dim thinking 😅 .
Agreed, let's go with that ! |
63d771b
to
fee2b46
Compare
@taldcroft do you like it now ? 😸 |
Description
Fixes #13292
running the test without the fix gives out a warning
Note that decorating the test with
@pytest.mark.filterwarnings("ignore")
allows to reproducethe exception that was originally reported.
To my surprise, simply following the advice given by the warning resolved the bug, and did not appear to break anything else !