Skip to content

Commit

Permalink
Fix NameError by properly defining Timedelta before using it
Browse files Browse the repository at this point in the history
  • Loading branch information
brownl83 committed Dec 3, 2024
1 parent 5b02464 commit fedd273
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
9 changes: 0 additions & 9 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,8 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.Period.freq GL08" \
-i "pandas.Period.ordinal GL08" \
-i "pandas.RangeIndex.from_range PR01,SA01" \
<<<<<<< HEAD
-i "pandas.Series.dt.unit GL08" \
-i "pandas.Series.pad PR01,SA01" \
=======
-i "pandas.Timedelta.max PR02" \
-i "pandas.Timedelta.min PR02" \
-i "pandas.Timedelta.resolution PR02" \
-i "pandas.Timestamp.max PR02" \
-i "pandas.Timestamp.min PR02" \
-i "pandas.Timestamp.resolution PR02" \
>>>>>>> upstream/main
-i "pandas.Timestamp.tzinfo GL08" \
-i "pandas.arrays.ArrowExtensionArray PR07,SA01" \
-i "pandas.arrays.IntervalArray.length SA01" \
Expand Down
6 changes: 3 additions & 3 deletions pandas/_libs/tslibs/timedeltas.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1945,9 +1945,9 @@ class Timedelta(_Timedelta):
_req_any_kwargs_new = {"weeks", "days", "hours", "minutes", "seconds",
"milliseconds", "microseconds", "nanoseconds"}

min = Timedelta(np.timedelta64(np.iinfo(np.int64).min + 1, 'ns'))
max = Timedelta(np.timedelta64(np.iinfo(np.int64).max, 'ns'))
resolution = Timedelta(1, unit='ns')
Timedelta.min = Timedelta(np.timedelta64(np.iinfo(np.int64).min + 1, 'ns'))
Timedelta.max = Timedelta(np.timedelta64(np.iinfo(np.int64).max, 'ns'))
Timedelta.resolution = Timedelta(1, unit='ns')

def __new__(cls, object value=_no_input, unit=None, **kwargs):
if value is _no_input:
Expand Down

0 comments on commit fedd273

Please sign in to comment.