Skip to content

Commit 5e04957

Browse files
authored
CLN: avoid internals in tz_convert, tz_localize (#33085)
1 parent 1d41be4 commit 5e04957

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/core/generic.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -9244,7 +9244,7 @@ def _tz_convert(ax, tz):
92449244
raise ValueError(f"The level {level} is not valid")
92459245
ax = _tz_convert(ax, tz)
92469246

9247-
result = self._constructor(self._data, copy=copy)
9247+
result = self.copy(deep=copy)
92489248
result = result.set_axis(ax, axis=axis, inplace=False)
92499249
return result.__finalize__(self)
92509250

@@ -9413,7 +9413,7 @@ def _tz_localize(ax, tz, ambiguous, nonexistent):
94139413
raise ValueError(f"The level {level} is not valid")
94149414
ax = _tz_localize(ax, tz, ambiguous, nonexistent)
94159415

9416-
result = self._constructor(self._data, copy=copy)
9416+
result = self.copy(deep=copy)
94179417
result = result.set_axis(ax, axis=axis, inplace=False)
94189418
return result.__finalize__(self)
94199419

0 commit comments

Comments
 (0)