Skip to content

BUG: datetime.date objects don't get parsed for non-ISO formats #50109

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 4 commits into from
Dec 11, 2022

Conversation

MarcoGorelli
Copy link
Member

@MarcoGorelli MarcoGorelli added the Datetime Datetime data dtype label Dec 7, 2022
Comment on lines +178 to +181
elif PyDate_Check(val):
iresult[i] = pydate_to_dt64(val, &dts)
check_dts_bounds(&dts)
continue
Copy link
Member Author

Choose a reason for hiding this comment

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

same as

elif PyDate_Check(val):
seen_datetime = True
iresult[i] = pydate_to_dt64(val, &dts)
check_dts_bounds(&dts)

Copy link
Member

Choose a reason for hiding this comment

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

do we need to worry about found_naive? (i guess we dont currently in the tslib code?)

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure we need to, datetime.dates can't have a timezone, so perhaps it's fine to just parse?

Copy link
Member

Choose a reason for hiding this comment

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

OK to punt on this for now

@MarcoGorelli MarcoGorelli force-pushed the parse-date-in-strptime branch from 0ef8556 to b707682 Compare December 7, 2022 18:18
@mroeschke mroeschke added this to the 2.0 milestone Dec 7, 2022
@MarcoGorelli MarcoGorelli merged commit ba74fee into pandas-dev:main Dec 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Datetime Datetime data dtype
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: datetime.date objects don't get parsed for non-ISO formats
3 participants