Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

DEPR: to_pydatetime return Index[object] #52459

Merged
merged 10 commits into from
Apr 8, 2023

Conversation

jbrockmendel
Copy link
Member

@mroeschke mroeschke added Deprecate Functionality to remove in pandas Datetime Datetime data dtype labels Apr 6, 2023
pandas/io/sql.py Outdated
with warnings.catch_warnings():
warnings.filterwarnings("ignore")
# GH#52459 to_pydatetime will return Index[object]
d = ser.dt.to_pydatetime()
Copy link
Member

Choose a reason for hiding this comment

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

Probably good to call np.asarray on d ahead of the deprecation enforcement since data_list is typed list[np.ndarray]

@mroeschke mroeschke added this to the 2.1 milestone Apr 7, 2023
Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
@mroeschke mroeschke merged commit efaa11e into pandas-dev:main Apr 8, 2023
@mroeschke
Copy link
Member

Thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the api-to_pydatetime branch April 8, 2023 00:32
@mroeschke
Copy link
Member

Should this have been done for to_pytimedelta too?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Datetime Datetime data dtype Deprecate Functionality to remove in pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API/INT: why is to_pydatetime handled differently in Series.dt accessor?
2 participants