(ax, tz, ambiguous, nonexistent)
| 11136 | ax = self._get_axis(axis) |
| 11137 | |
| 11138 | def _tz_localize(ax, tz, ambiguous, nonexistent): |
| 11139 | if not hasattr(ax, "tz_localize"): |
| 11140 | if len(ax) > 0: |
| 11141 | ax_name = self._get_axis_name(axis) |
| 11142 | raise TypeError( |
| 11143 | f"{ax_name} is not a valid DatetimeIndex or PeriodIndex" |
| 11144 | ) |
| 11145 | ax = DatetimeIndex([], tz=tz) |
| 11146 | else: |
| 11147 | ax = ax.tz_localize(tz, ambiguous=ambiguous, nonexistent=nonexistent) |
| 11148 | return ax |
| 11149 | |
| 11150 | # if a level is given it must be a MultiIndex level or |
| 11151 | # equivalent to the axis name |
nothing calls this directly
no test coverage detected