Skip to content

Conversation

MarcoGorelli
Copy link
Member

Does this need a whatsnew? I wouldn't have thought so, as this wasn't available in 1.5.x

@MarcoGorelli MarcoGorelli added Bug Non-Nano datetime64/timedelta64 with non-nanosecond resolution labels Jan 12, 2023
@@ -372,7 +372,7 @@ def _wrap_results(result, dtype: np.dtype, fill_value=None):
if isna(result):
result = np.datetime64("NaT", "ns")
else:
result = np.int64(result).view("datetime64[ns]")
result = np.int64(result).view(dtype)
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 do the nat case a couple lines up too just to be on the safe side (like we do for td64 below)

@MarcoGorelli MarcoGorelli marked this pull request as draft January 12, 2023 21:45
@MarcoGorelli MarcoGorelli marked this pull request as ready for review January 13, 2023 09:03
@jorisvandenbossche jorisvandenbossche added this to the 2.0 milestone Jan 13, 2023
Copy link
Member

@jbrockmendel jbrockmendel left a comment

Choose a reason for hiding this comment

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

LGTM

@MarcoGorelli
Copy link
Member Author

thanks - merging then as this is quite simple and unblocks rewriting tests for #50656

@MarcoGorelli MarcoGorelli merged commit 7afbdf1 into pandas-dev:main Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Non-Nano datetime64/timedelta64 with non-nanosecond resolution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: .max() gives wrong answer for non-nanosecond datetimeindex
3 participants