Skip to content

Conversation

prazian
Copy link

@prazian prazian commented Aug 18, 2025

@prazian prazian marked this pull request as draft August 18, 2025 13:23
@prazian prazian changed the title Fixs bug 62111/to csv microsecond inconsistency BUG: Fix to_csv microsecond inconsistency (#62111) Aug 18, 2025
@prazian prazian force-pushed the bug-62111/to_csv-microsecond-inconsistency branch from d5bd317 to a5fa547 Compare August 18, 2025 14:01
@prazian prazian changed the title BUG: Fix to_csv microsecond inconsistency (#62111) BUG: Fix to_csv microsecond inconsistency Aug 18, 2025
@prazian prazian changed the title BUG: Fix to_csv microsecond inconsistency BUG: Fix to_csv microsecond inconsistency (#62111) Aug 18, 2025
@prazian prazian marked this pull request as ready for review August 18, 2025 14:05
Copy link
Member

@rhshadrach rhshadrach left a 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!

Comment on lines +720 to +725
"""
tz-aware timestamps with/without microseconds should be written consistently
Checks if the .ffffff format is consistent, even when microseconds==0
GH 62111
"""
Copy link
Member

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.

Comment on lines +328 to +329
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)
Copy link
Member

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)
Copy link
Member

Choose a reason for hiding this comment

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

Why astype(str)?

@mroeschke
Copy link
Member

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.

@mroeschke mroeschke closed this Oct 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: to_csv uses inconsistent microsecond format for datetimes with timezones

3 participants