-
-
Notifications
You must be signed in to change notification settings - Fork 19.1k
BUG: Fix to_csv microsecond inconsistency (#62111) #62139
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
BUG: Fix to_csv microsecond inconsistency (#62111) #62139
Conversation
d5bd317
to
a5fa547
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
""" | ||
tz-aware timestamps with/without microseconds should be written consistently | ||
Checks if the .ffffff format is consistent, even when microseconds==0 | ||
GH 62111 | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move this inside the test function.
s = ser.dt.strftime("%Y-%m-%d %H:%M:%S.%f%z") | ||
s = s.str.replace(r"([+-]\d{2})(\d{2})$", r"\1:\2", regex=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not clear to me why this replace is necessary, can you give a case?
with microseconds and colonized offset. Leave other objects untouched. | ||
""" | ||
if ser.empty: | ||
return ser.astype(str) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why astype(str)?
Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen. |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.