Skip to content

Conversation

Alvaro-Kothe
Copy link
Contributor


I had to branch out between finite and NA-only in check_to_int_nansafe because of this error:

E TypeError: ufunc 'isfinite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''

Infinite values in datetime-like types when casting to int raises other errors, for example:

  • overflow: when the series contains only the inf.
  • TypeError: when the series contains inf and another value.

Previously, it was converting it to -2^63.
@jbrockmendel
Copy link
Member

It is t clear this is what we want to do. There was discussion about allowing int casting at all.

@Alvaro-Kothe
Copy link
Contributor Author

Alvaro-Kothe commented Sep 27, 2025

It is t clear this is what we want to do.

Ok, let me know if this should be closed.

There was discussion about allowing int casting at all.

Do you have the issue/PR number for the record?

@jbrockmendel
Copy link
Member

not off the top of my head. i suspect it was opened by joris

@Alvaro-Kothe
Copy link
Contributor Author

@jbrockmendel please, confirm if it's this one: #45588

@jbrockmendel
Copy link
Member

#45034

@mroeschke mroeschke added the Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate label Sep 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: converting null timedelta to int with astype() changes NaT to -9223372036854775808
3 participants