(ax, tz)
| 10925 | ax = self._get_axis(axis) |
| 10926 | |
| 10927 | def _tz_convert(ax, tz): |
| 10928 | if not hasattr(ax, "tz_convert"): |
| 10929 | if len(ax) > 0: |
| 10930 | ax_name = self._get_axis_name(axis) |
| 10931 | raise TypeError( |
| 10932 | f"{ax_name} is not a valid DatetimeIndex or PeriodIndex" |
| 10933 | ) |
| 10934 | ax = DatetimeIndex([], tz=tz) |
| 10935 | else: |
| 10936 | ax = ax.tz_convert(tz) |
| 10937 | return ax |
| 10938 | |
| 10939 | # if a level is given it must be a MultiIndex level or |
| 10940 | # equivalent to the axis name |
nothing calls this directly
no test coverage detected