-
-
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
Dropped Support for Custom Metadata Types #8625
Comments
Thanks for opening this @DamianBarabonkovQC this was definitely not an intentional effect. I will change it to accept an iterable an ping you on the PR. |
Ok so I don't think this was ever supported how you expected. If I revert #8563 and run your code I get meta as a pandas.Series with dtype = "object". This is because you haven't instantiated the class so it is interpreted as an object. If you do instantiate the class, you get a different error: ddf.map_partitions(myadd, 1, b=2, meta=CustomMetadata())
# TypeError: Don't know how to create metadata from <__main__.CustomMetadata object at 0x7fd88f40df40> So I guess I'm a little confused if this ever worked properly and I have two proposed fixes. |
Regarding the kartothek library, the MetaPartition class is not a dask meta object. If anything, you could have a dask Series with elements of type |
What happened:
A recent pull request titled "Fail if meta is not a pandas object": #8563 breaks support for custom metadata types in dask. This pull request was motivated by the issue: #8537.
In our codebase, we use a custom Python class which is iterable as the dask metadata value. I would like to kindly ask if this dropped support is intentional. According to the documentation of
DataFrame.map_partitions
, themeta
parameter may be one of "pd.DataFrame, pd.Series, dict, iterable, tuple".More specifically, this relates to the Kartothek library with this affected custom metadata class.
What you expected to happen:
The expected behavior is to maintain support for iterable custom metadata classes, as dask did before the aforementioned pull request. This change breaks our code.
Minimal Complete Verifiable Example:
Below is a simplified code snippet reproducing this new behavior.
Environment:
The text was updated successfully, but these errors were encountered: