-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
REG: dt64 shift with integer fill_value #32591
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks nice thanks.
Will need a release note in 1.0.2.
Do we have a policy on introducing warnings in bugfix releases? Technically this deprecation should have been done in 1.0, so maybe it's OK. Or the warning can wait till 1.1.
According to https://pandas.pydata.org/docs/development/policies.html
But perhaps it's OK here since this is fixing a bug (failure to deprecate something in 1.0). I don't have a strong preference. |
fill_value = NaT | ||
elif not isinstance(fill_value, self._recognized_scalars): | ||
# only warn if we're not going to raise | ||
if self._scalar_type is Period and lib.is_integer(fill_value): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isinstance?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"is" is on purpose here
pandas/core/arrays/datetimelike.py
Outdated
elif not isinstance(fill_value, self._recognized_scalars): | ||
# only warn if we're not going to raise | ||
if self._scalar_type is Period and lib.is_integer(fill_value): | ||
# kludge for #31971 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a comment of what this is
if f_ordered: | ||
new_values = new_values.T | ||
axis = new_values.ndim - axis - 1 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is similar to the shift we have in block values yes? this should at some point be a routine in missing.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ideally doing it in this PR but if too hard to backport ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yah, i was thinking core.algos directory for algorithms-like functions that are specifically only ndarray/EA
@jbrockmendel can you update doc-strings, otherwise lgtm. |
updated+green; i think ive addressed the relevant comments |
thanks, let's see if this backports |
@meeseeksdev backport 1.0.x |
Something went wrong ... Please have a look at my logs. |
@TomAugspurger did this get backported successfully or do i still need to do it manually? |
#32647 backported it. I think the thing about the error is from the auto-backport and Jeff's manual request kicking in around the same time, so the second one errored since the backport was already created (maybe). |
right i am sure not if things backport so i usuually kick the bot which i think is safe (it won’t do it twice) but found that if it needs a manual backport it shows immediately which is good |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff