Skip to content
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

Disallow lossy SparseArray conversion #32501

Merged
merged 3 commits into from Mar 14, 2020

Conversation

jbrockmendel
Copy link
Member

Copy link
Contributor

@TomAugspurger TomAugspurger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The behavior on master is to silently convert to UTC? We should likely detect that, warn, and ask users to convert before passing to SparseArray.

@jreback jreback added the Sparse Sparse Data Type label Mar 8, 2020
@jbrockmendel
Copy link
Member Author

We should likely detect that, warn, and ask users to convert before passing to SparseArray.

This gets hairy in a way that im not sure is worth it. In particular for tzaware, if instead of raising we fall through to data = np.array(data), we get object-dtype, and fill_value of np.nan instead of NaT.

@jbrockmendel
Copy link
Member Author

Updated to warn and maintain current behavior.

@jreback jreback added this to the 1.1 milestone Mar 14, 2020
@jreback jreback added the Warnings Warnings that appear or should be added to pandas label Mar 14, 2020
@jreback jreback merged commit 029f707 into pandas-dev:master Mar 14, 2020
@jreback
Copy link
Contributor

jreback commented Mar 14, 2020

thanks, pls add a whatsnew as a followon

@jbrockmendel jbrockmendel deleted the no-values_from_object-sparse branch March 14, 2020 16:47
SeeminSyed pushed a commit to CSCD01-team01/pandas that referenced this pull request Mar 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Sparse Sparse Data Type Warnings Warnings that appear or should be added to pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants