pub enum PandasTemporalError {
Overflow,
OutOfBoundsDatetime,
OutOfBoundsTimedelta,
OverflowInTimedeltaOperation,
ZeroDivision,
}Expand description
The pandas-side exception class a failed temporal operation corresponds to.
Introduced by br-frankenpandas-fyr1z-policy-carrier-f29nz and completed by fyr1z.3, which established that pandas uses FIVE distinct classes here — so a STRICT arm must raise the RIGHT one per op rather than a blanket type. Every mapping below was probed against live pandas 2.2.3, not inferred.
Named ...TemporalError rather than ...OverflowError because
Self::ZeroDivision is not an overflow; a type whose name promised
“overflow” while carrying divide-by-zero would be exactly the kind of stale
label this codebase keeps having to correct.
Variants§
Overflow
OverflowError. e.g. pd.Timedelta.max + pd.Timedelta('1ns'), and
Series + Timedelta / Series - Series / .diff() which report
“Overflow in int64 addition”.
OutOfBoundsDatetime
OutOfBoundsDatetime. e.g. pd.Timestamp.max + pd.Timedelta('1ns')
and pd.Timestamp.min - pd.Timestamp.max.
OutOfBoundsTimedelta
OutOfBoundsTimedelta. Raised by the pd.Timedelta(value, unit=...)
constructor path (see br-frankenpandas-8v92m), not by the six
arithmetic helpers below. Probed: pd.Timedelta(float('inf'), 's') ->
“Cannot cast inf from s to ‘ns’ without overflow.”
OverflowInTimedeltaOperation
ValueError("overflow in timedelta operation"). Raised by the
REDUCTIONS Series.sum() and Series.std() over timedelta64.
ZeroDivision
ZeroDivisionError. Raised by SCALAR Timedelta // 0, Timedelta / 0
and Timedelta // 0.0 ONLY.
⚠ The VECTORIZED division family does NOT raise: probed,
Series([Timedelta]) // 0 and / 0 both return NaT. A STRICT arm must
not widen this class to the vectorized surface — doing so would create
divergence where FrankenPandas is already bit-for-bit correct, which is
the central finding of br-frankenpandas-fyr1z (see DISC-018).