Closed gdementen closed 2 months ago
FWIW, for __setitem__
, the picture was a bit different: it somehow/somewhat worked: missing keys were considered False and extra keys were ignored as long as the filter was False for them
>>> arr[f2] = 99
>>> arr
a\b b0 b1 b2 b3
a0 0 1 2 3
a1 4 5 99 99
>>> f3 = f2.append('b', True, label='b42')
>>> f3
a\b b0 b2 b3 b42
a0 False False False True
a1 False True True True
>>> arr[f3]
ValueError: b['b42', 'b2', 'b3', 'b42'] is not a valid label for any axis
>>> f3 = f2.append('b', False, label='b42')
>>> f3
a\b b0 b2 b3 b42
a0 False False False False
a1 False True True False
>>> arr[f3] = 42
>>> arr
a\b b0 b1 b2 b3
a0 0 1 2 3
a1 4 5 42 42
but the included fix (to raise on incompatible axes) is still a good thing IMO
This is complete junk.
I see three options going forward:
Currently, I think it would be best to implement 1, until we implement align by default for all operations, in which case 3. would make more sense. I might revise my judgment on option 2 if it turns out absolutely necessary to solve #1084.
FWIW, I don't think this is worth blocker priority even though this is a "silent" failure because the extra "combined" axis would be very quickly spotted by users.