Skip to content

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

Merged
merged 5 commits into from
Mar 12, 2020

Conversation

jbrockmendel
Copy link
Member

@jbrockmendel jbrockmendel commented Mar 10, 2020

@TomAugspurger TomAugspurger added this to the 1.0.2 milestone Mar 10, 2020
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.

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.

@TomAugspurger
Copy link
Contributor

Do we have a policy on introducing warnings in bugfix releases?

According to https://pandas.pydata.org/docs/development/policies.html

We will not introduce new deprecations in patch releases.

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.

@jreback jreback added the Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate label Mar 11, 2020
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):
Copy link
Contributor

Choose a reason for hiding this comment

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

isinstance?

Copy link
Member Author

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

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
Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Member Author

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

@jreback
Copy link
Contributor

jreback commented Mar 11, 2020

@jbrockmendel can you update doc-strings, otherwise lgtm.

@jbrockmendel
Copy link
Member Author

updated+green; i think ive addressed the relevant comments

@jreback jreback merged commit 9bc3ee0 into pandas-dev:master Mar 12, 2020
@jreback
Copy link
Contributor

jreback commented Mar 12, 2020

thanks, let's see if this backports

@jreback
Copy link
Contributor

jreback commented Mar 12, 2020

@meeseeksdev backport 1.0.x

@lumberbot-app
Copy link

lumberbot-app bot commented Mar 12, 2020

Something went wrong ... Please have a look at my logs.

@jbrockmendel
Copy link
Member Author

@TomAugspurger did this get backported successfully or do i still need to do it manually?

@TomAugspurger
Copy link
Contributor

#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).

@jreback
Copy link
Contributor

jreback commented Mar 12, 2020

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

@jbrockmendel jbrockmendel deleted the regr-dtshift branch March 12, 2020 17:02
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
Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

shift() broken for datetime64 when used with fill_value
3 participants