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

check early for non-scalar default_fill_value #27302

Merged
merged 3 commits into from
Jul 10, 2019

Conversation

jbrockmendel
Copy link
Member

Broken off of an in-progress division-by-zero branch

@@ -74,6 +75,8 @@ def __init__(
dtype=None,
copy=False,
):
if not is_scalar(default_fill_value):
Copy link
Member

Choose a reason for hiding this comment

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

Is a dict acceptable here at all? Think we allow that for normal DataFrame fillna

Copy link
Member Author

Choose a reason for hiding this comment

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

@TomAugspurger are there cases where non-scalar is accepted? I was getting errors in another branch caused by zero-dim ndarray getting through here.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't believe we allow this (nor should)

@WillAyd WillAyd added the Sparse Sparse Data Type label Jul 9, 2019
@jreback jreback added this to the 0.25.0 milestone Jul 9, 2019
@jreback
Copy link
Contributor

jreback commented Jul 9, 2019

is there an issue for this? I guess currently this raises but its an incorrect description of the error?

@jreback jreback added the Error Reporting Incorrect or improved errors from pandas label Jul 9, 2019
@jbrockmendel
Copy link
Member Author

is there an issue for this? I guess currently this raises but its an incorrect description of the error?

ATM this raises once it gets passed to SparseArray. The actual bug this fixes is the fill_value = func(...) on 471.

@jreback jreback merged commit c0c1c9a into pandas-dev:master Jul 10, 2019
@jreback
Copy link
Contributor

jreback commented Jul 10, 2019

thanks

@jbrockmendel jbrockmendel deleted the sparse_scalar branch July 10, 2019 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Error Reporting Incorrect or improved errors from pandas Sparse Sparse Data Type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants