Skip to content

BUG: read_csv not converting original col with keep_date_col true #44633

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 3 commits into from
Nov 28, 2021

Conversation

phofl
Copy link
Member

@phofl phofl commented Nov 26, 2021

@phofl phofl added the IO CSV read_csv, to_csv label Nov 26, 2021
@jreback jreback added this to the 1.4 milestone Nov 26, 2021
@@ -1148,6 +1148,10 @@ def _isindex(colspec):
)

new_data[new_name] = col

if len(colspec) == 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 seems like very special casey here

Copy link
Member Author

Choose a reason for hiding this comment

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

It is, yes. We can only keep the original column formatted as date, if it represents the whole date. In cases where two columns combined represent a date we can only keep the original format

Copy link
Contributor

Choose a reason for hiding this comment

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

ok worth a comment about this then for future readers

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@jreback jreback merged commit 035501e into pandas-dev:master Nov 28, 2021
@phofl phofl deleted the 13378 branch November 28, 2021 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO CSV read_csv, to_csv
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: in read_csv, keep_date_cols doesn't result in correct dtype
2 participants