Skip to content

REGR: Change to Series[dt64/td64].astype("string")` behavior on master #41409

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

Closed
simonjayhawkins opened this issue May 10, 2021 · 7 comments · Fixed by #41958
Closed

REGR: Change to Series[dt64/td64].astype("string")` behavior on master #41409

simonjayhawkins opened this issue May 10, 2021 · 7 comments · Fixed by #41958
Labels
Datetime Datetime data dtype Regression Functionality that used to work in a prior pandas version Strings String extension data type and string data Timedelta Timedelta data type
Milestone

Comments

@simonjayhawkins
Copy link
Member

xref #38562 (comment) cc @jbrockmendel

old behaviour

>>> pd.__version__
'1.2.4'
>>> 
>>> tdi = pd.timedelta_range("1 Day", periods=3)
>>> ser = pd.Series(tdi)
>>> ser
0   1 days
1   2 days
2   3 days
dtype: timedelta64[ns]
>>> ser.astype("string")
0    1 days
1    2 days
2    3 days
dtype: string
>>> 
>>> dti = pd.date_range("2021", periods=3)
>>> ser = pd.Series(dti)
>>> ser
0   2021-01-01
1   2021-01-02
2   2021-01-03
dtype: datetime64[ns]
>>> ser.astype("string")
0    2021-01-01
1    2021-01-02
2    2021-01-03
dtype: string

new behaviour

>>> pd.__version__
'1.3.0.dev0+1567.g67c9385787'
>>> 
>>> tdi = pd.timedelta_range("1 Day", periods=3)
>>> ser = pd.Series(tdi)
>>> ser
0   1 days
1   2 days
2   3 days
dtype: timedelta64[ns]
>>> ser.astype("string")
0     86400000000000 nanoseconds
1    172800000000000 nanoseconds
2    259200000000000 nanoseconds
dtype: string
>>> 
>>> dti = pd.date_range("2021", periods=3)
>>> ser = pd.Series(dti)
>>> ser
0   2021-01-01
1   2021-01-02
2   2021-01-03
dtype: datetime64[ns]
>>> ser.astype("string")
0    2021-01-01T00:00:00.000000000
1    2021-01-02T00:00:00.000000000
2    2021-01-03T00:00:00.000000000
dtype: string
>>> 
@simonjayhawkins simonjayhawkins added Datetime Datetime data dtype Regression Functionality that used to work in a prior pandas version Timedelta Timedelta data type Strings String extension data type and string data labels May 10, 2021
@simonjayhawkins simonjayhawkins added this to the 1.3 milestone May 10, 2021
@jbrockmendel
Copy link
Member

xref #38509 other direction

@simonjayhawkins
Copy link
Member Author

@jbrockmendel adding the blocker to this. we shouldn't release with this change?

@simonjayhawkins simonjayhawkins added the Blocker Blocking issue or pull request for an upcoming release label May 25, 2021
@jbrockmendel
Copy link
Member

adding the blocker to this. we shouldn't release with this change?

i wouldn't raise a fuss if we release without fixing this. ill take a look soonish at what it would take to revert/fix

@simonjayhawkins
Copy link
Member Author

Thanks. sure, not a blocker for rc since we can fix things things like this after but before actual release. At the moment, trying to establish what's outstanding before we can do the rc.

@jbrockmendel
Copy link
Member

@simonjayhawkins im catching up on an email backlog. is this a short-term priority?

@simonjayhawkins
Copy link
Member Author

getting shorter! we should really do this for 1.3.0rc0 but if not 1.3. If we release 1.3 without fixing, we'll need to backport to 1.3.x as this is a regression.

@simonjayhawkins
Copy link
Member Author

removing the blocker tag as if not done before 1.3 release, milestone will be updated to 1.3.1 to keep track of this regression. Ideally since we are aware of this regression, we would not release without fixing, but we have other regressions also on master without the blocker label so don't need to make this a special case.

@simonjayhawkins simonjayhawkins removed the Blocker Blocking issue or pull request for an upcoming release label Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Datetime Datetime data dtype Regression Functionality that used to work in a prior pandas version Strings String extension data type and string data Timedelta Timedelta data type
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants