Skip to content

Commit

Permalink
troubleshoot 32bit builds
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrockmendel committed Dec 9, 2023
1 parent 5bee11c commit 8aa9653
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions pandas/core/arrays/datetimelike.py
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,7 @@ def _add_datetimelike_scalar(self, other) -> DatetimeArray:
self = cast("TimedeltaArray", self)

other_i8, o_mask = self._get_i8_values_and_mask(other)
result = add_overflowsafe(self.asi8, np.asarray(other_i8))
result = add_overflowsafe(self.asi8, np.asarray(other_i8, dtype="i8"))
res_values = result.view(f"M8[{self.unit}]")

dtype = tz_to_dtype(tz=other.tz, unit=self.unit)
Expand Down Expand Up @@ -1132,7 +1132,7 @@ def _sub_datetimelike(self, other: Timestamp | DatetimeArray) -> TimedeltaArray:
raise type(err)(new_message) from err

other_i8, o_mask = self._get_i8_values_and_mask(other)
res_values = add_overflowsafe(self.asi8, np.asarray(-other_i8))
res_values = add_overflowsafe(self.asi8, np.asarray(-other_i8, dtype="i8"))
res_m8 = res_values.view(f"timedelta64[{self.unit}]")

new_freq = self._get_arithmetic_result_freq(other)
Expand Down Expand Up @@ -1198,7 +1198,7 @@ def _add_timedeltalike(self, other: Timedelta | TimedeltaArray):
self = cast("DatetimeArray | TimedeltaArray", self)

other_i8, o_mask = self._get_i8_values_and_mask(other)
new_values = add_overflowsafe(self.asi8, np.asarray(other_i8))
new_values = add_overflowsafe(self.asi8, np.asarray(other_i8, dtype="i8"))
res_values = new_values.view(self._ndarray.dtype)

new_freq = self._get_arithmetic_result_freq(other)
Expand Down Expand Up @@ -1266,7 +1266,7 @@ def _sub_periodlike(self, other: Period | PeriodArray) -> npt.NDArray[np.object_
self._check_compatible_with(other)

other_i8, o_mask = self._get_i8_values_and_mask(other)
new_i8_data = add_overflowsafe(self.asi8, np.asarray(-other_i8))
new_i8_data = add_overflowsafe(self.asi8, np.asarray(-other_i8, dtype="i8"))
new_data = np.array([self.freq.base * x for x in new_i8_data])

if o_mask is None:
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/period.py
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ def _addsub_int_array_or_scalar(
assert op in [operator.add, operator.sub]
if op is operator.sub:
other = -other
res_values = add_overflowsafe(self.asi8, np.asarray(other))
res_values = add_overflowsafe(self.asi8, np.asarray(other, dtype="i8"))
return type(self)(res_values, dtype=self.dtype)

def _add_offset(self, other: BaseOffset):
Expand Down

0 comments on commit 8aa9653

Please sign in to comment.