`from_dataframe` gets a `cast_extension_array` argument
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.2k
- Forks
- 1.4k
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 14
Description
Is your feature request related to a problem?
To resolve the ongoing discussion around extension array casting, an option that has arisen would be to add a cast_extension_array argument (see https://github.com/pydata/xarray/issues/10301#issuecomment-2866569942 as well) to from_dataframe in order to give users "old" behavior (see #10301 for an exmaple where this might help).
Whether this is default true or false is up for debate probably but I think this is a great feature independent of the chaos that has arisen.
Describe the solution you'd like
from_dataframe gets a cast_extension_array argument
Describe alternatives you've considered
The alternative would basically be continuing to fix things as they arise and being totally permissive. But that is what is going to likely happen anyway (i.e., you can set on a Dataset with an extension array type anyway given this feature, no issue).
Additional context
cc @dcherian @keewis
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the from_dataframe entry point and read the linked #10301 discussion to understand the extension-array casting behavior and unresolved default. Done means the new argument is supported with an agreed default and tests demonstrate both the existing and alternative casting behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- pandas, python
- Domain
- api, data
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100