-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
__finalize__ called with other as _Concatenator? #18999
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
Comments
can you demonstrate an actual example? |
|
@jbrockmendel That is code that I recently rewrote (#17728), so it is quite possible I introduces a bug. However, I cannot reproduce the exact error you get. I get:
and I already get to for 0.20.3 as well. |
Ah, there was a And I suppose that I meant to pass the first object from the list to concat instead of However, it seems that I just did how it was already done before (using this |
OK, I understand what changed the behaviour. Before my PR (#17728), Lines 4000 to 4003 in 8acdf80
Given that, I would argue the current code might be correct, as passing through the metadata of the first object is maybe not the best default? (Eg that would ignore different metadata in the different objects you are concatting). |
Good catch. I just edited the previous comment to fix that mistake.
I think you're right that the problem above would be fixed by having a
|
Because it is a truncated repr, concatting first and last part.
That object holds more information, eg the list of all concatenated objects. So for example you could check for a certain metadata field if all objects have the same value, and only in that case set it on the resulting object. |
This is probably closable, possibly worth keeping around on some tracker for "subclassing pitfalls" |
@jbrockmendel want to do a PR to mention this in the subclassing docs? |
Revisiting some 6 month old class that subclasses
Series
and overrides__finalize__
as:With 0.21.1 these objects can no longer be rendered:
I had assumed that
other
would always be of the same class asself
. Is_Concatenator
a recent addition?The text was updated successfully, but these errors were encountered: