Skip to content

(fix): allow upcasting of nans in as_shared_dtype for extension arrays #10292

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

Merged
merged 8 commits into from
May 8, 2025

Conversation

ilan-gold
Copy link
Contributor

@ilan-gold ilan-gold commented May 7, 2025

To solve the underlying issue of reindexing with a fill value on an extension array (the test added is a reproducer), we special case nan values for type promotion because they are native pandas object that should be handled by the underlying extension arrays, which have a concept of nans in general (i.e., not specific to one kind of extension array, see: https://pandas.pydata.org/docs/reference/api/pandas.api.extensions.ExtensionArray.fillna.html)

Note this PR does not change the behavior otherwise - we still disallow categoricals, for example, from being collectively type-promoted. That could come in a separate PR, but would require further special casing i.e., for #10247

cc @ilia-kats

@github-actions github-actions bot added topic-documentation topic-arrays related to flexible array support labels May 7, 2025
@ilan-gold ilan-gold requested a review from dcherian May 7, 2025 17:13
@dcherian dcherian added the plan to merge Final call for comments label May 7, 2025
@dcherian dcherian merged commit dd9a46b into pydata:main May 8, 2025
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plan to merge Final call for comments topic-arrays related to flexible array support topic-documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy