-
Notifications
You must be signed in to change notification settings - Fork 21
How to enable the Standard? #115
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
I'd be fine with a dunder method if we can bikeshed away from "standard" to something more neutral e.g. "consortium" |
I suggest For phase 1 the approach you suggested works, or just monkeypatch |
sure, but this would require that |
The package implementing the standard on top of pandas can do this monkey-patching (on the short term), so that package would depend on pandas anyway. |
Probably the most fundamental question
Say we have
dfpd
, which is a pandas DataFramePandasStandardDataFrame
, which is the pandas implementation of the Standard. It takes a pandas DataFrame and returns a class which only has the methods supported by the Standard. Say this is available on PyPI aspandas-standard
(...and similarly for modin / cudf / vaex / anyone else)
Right. Say I want to write a function which can accept any DataFrame, like
How do we do the first line, i.e. getting
df_standard
?I think the ideal place to get to would be
but this can't happen overnight, especially if we want to stick to the mantra @jbrockmendel had mentioned here
Phase 1
This a hacky, but allows for quick experimentation without needing to depend on pandas' approvals, or on the pandas' relatively slow release cycle, or those of any other library.
Consumers of the Standard would need to write something like
At the moment the Consortium is still relatively small, so enumerating the options in
if-then
statements should be manageable.Phase 2
Once we've seen that some libraries are actually able to use it to write portable code, then pandas could add a method like
, and similarly for other libraries.
I'd like think that something so small would be a relatively easy sell to the pandas-dev team - @jbrockmendel , @jorisvandenbossche, do you agree? Would you be OK with this? Do you have other suggestions for how to opt-in to the standard?
Note that consumers would need to have
pandas-standard
installed for this to work.(optional) phase 3
dfpd.__dataframe_standard__()
would work without requiring extra dependencies (either becausepandas_standard
has become a runtime dependency of pandas, or because the standard is implemented within pandas).I think this is what some, such as @aregm would like to see happen.
Usual reminder that I think this is unlikely to pass - nonetheless, it's not off the table, and some participants would find it desirable, so I've kept it in.
The text was updated successfully, but these errors were encountered: