-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
EA.fillna(method) deprecation and EA.pad_or_backfill issues #54831
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
+1
In untangling the DataFrame/Manager/Block/EA methods one pain point was that we use different/multiple method names and different levels. I don't particularly care what the eventual name is, but would like for us to have a single consistent name at each level of the call stack (possible leading underscore not-withstanding)
As above, I'm fine with this as long as we make it consistent from NDFrame->Manager->Block->EA.
AFAIK users don't really use EAs directly. Do you have reason to believe otherwise? I'm fine with making things private as being a safer option (easier to un-privatize later than the other way around). |
OK, given we already use I opened #54838 for doing the
I don't know if many users do use those EA methods directly, but nevertheless you can get an EA easily through public API, and so all methods on EAs are public, so I don't think we should expose something like "pad_or_backfill" in our user-visible public namespace. Now, it's true that we can always still add public |
One additional aspect of the new EA API that I noticed while doing #54838, is that the So I think we can easily remove |
Are we good with enforcing this deprecation for 3.0? I'm looking to enforce the deprecation of |
I think so, yes. We have been warning about this since 2.1, so fine with enforcing that for 3.0 |
Thanks - just want to make sure: this is okay to enforce without promoting to FutureWarning because the warning targets EA authors. Is that right? |
I have been looking at the
EA.fillna
method
keyword deprecation (original PR at #54001) from the point of view of a downstream EA implementation (from looking into geopandas CI's warnings for the release candidate)Two issues I am noting:
1) When an external EA currently has a
fillna
method accepting the method keyword, the user sees three deprecation warnings (the third might be specific to the geopandas example, because of callingsuper().fillna(..)
inGeometryArray.fillna()
):This might be as simple as changing the second warning to a DeprecationWarning for now (the third one might not be easy to avoid, as mentioned above this is called in the geopandas implementation through
super().fillna()
, and we still want to deprecate direct usage of the EA.fillna method as well)2) This added a new method to the ExtensionArray, which is
pad_or_backfill
. Some issues with this name:_pad_or_backfill
(like the other official EA methods starting with an underscore), or actually_ffill_or_bfill
to use the non-deprecated names.EA.fillna(method=..)
are deprecated and currently point topad_or_backfill
. If we don't make this public for end users (point above), then we don't have anything to point to. If we still want to keep this user-accessible at the EA level, we could also simply addffill
andbfill
methods to the EA? (to make it consistent with the methods on the Series level)The first option is very easy to do (simple search/replace on the name), but maybe adding both
ffill
andbfill
as public methods (our own EAs could still dispatch to a shared implementation if that is the easiest) might be the cleaner option long term? And @jbrockmendel based on your comment in the original issue about adding those methods (#53621), I suppose you would be fine with that? (not sure if there was a specific reason to change your mind for the PR to use a combined method?)Given that those methods need to be implemented by downstream EAs, ideally we get a final naming in for 2.1.0 (or otherwise a quick 2.1.1). But I could look into it tomorrow if we agree on the best path forward.
The text was updated successfully, but these errors were encountered: