Skip to content

BUG: arg validation in DTA/TDA/PA.take, DTI/TDI/PI.where #33685

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 3 commits into from
Apr 25, 2020

Conversation

jbrockmendel
Copy link
Member

We have a lot of really similar validation/casting methods in these classes. This is a step in smoothing out the differences between them so we can share them.

@jreback jreback added the Refactor Internal refactoring of code label Apr 21, 2020
@jreback jreback added this to the 1.1 milestone Apr 21, 2020
@jreback
Copy link
Contributor

jreback commented Apr 21, 2020

looks fine, pls rebase

@jbrockmendel
Copy link
Member Author

rebased+green

@@ -508,6 +508,12 @@ def test_take_fill_valid(self, datetime_index, tz_naive_fixture):
# require NaT, not iNaT, as it could be confused with an integer
arr.take([-1, 1], allow_fill=True, fill_value=value)

value = np.timedelta64("NaT", "ns")
msg = f"'fill_value' should be a {self.dtype}. Got '{str(value)}'."
Copy link
Member

Choose a reason for hiding this comment

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

I think normally shouldn't need str in f-string. could this be a numpy bug?

Copy link
Member Author

Choose a reason for hiding this comment

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

i forget exactly which case broke without the extra str, but plausibly numpy

@jreback jreback merged commit 3c09d22 into pandas-dev:master Apr 25, 2020
@jbrockmendel jbrockmendel deleted the isna-compat branch April 25, 2020 21:10
rhshadrach pushed a commit to rhshadrach/pandas that referenced this pull request May 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Refactor Internal refactoring of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants