diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py index 0e886befb5f2f..eedf00bcd9c76 100644 --- a/pandas/io/pytables.py +++ b/pandas/io/pytables.py @@ -2093,11 +2093,8 @@ def convert(self, values: np.ndarray, nan_rep, encoding: str, errors: str): if "freq" in kwargs: kwargs["freq"] = None new_pd_index = factory(values, **kwargs) - - # error: Incompatible types in assignment (expression has type - # "Union[ndarray, DatetimeIndex]", variable has type "Index") - new_pd_index = _set_tz(new_pd_index, self.tz) # type: ignore[assignment] - return new_pd_index, new_pd_index + final_pd_index = _set_tz(new_pd_index, self.tz) + return final_pd_index, final_pd_index def take_data(self): """return the values"""