From 98fb91408ce5b17695c00cbbd0c0b421e9832752 Mon Sep 17 00:00:00 2001 From: prithvijitguha Date: Wed, 17 Nov 2021 20:36:52 +0530 Subject: [PATCH 1/3] fixed type ignore --- pandas/io/pytables.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py index 0e886befb5f2f..5bbbd25c90f9d 100644 --- a/pandas/io/pytables.py +++ b/pandas/io/pytables.py @@ -2096,8 +2096,8 @@ def convert(self, values: np.ndarray, nan_rep, encoding: str, errors: str): # 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""" From 361b2ffc001348389a7452c86b68441058810de9 Mon Sep 17 00:00:00 2001 From: prithvijitguha Date: Wed, 17 Nov 2021 20:57:03 +0530 Subject: [PATCH 2/3] pre commit fixes --- pandas/io/pytables.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py index 5bbbd25c90f9d..267c04d212082 100644 --- a/pandas/io/pytables.py +++ b/pandas/io/pytables.py @@ -2096,7 +2096,7 @@ def convert(self, values: np.ndarray, nan_rep, encoding: str, errors: str): # error: Incompatible types in assignment (expression has type # "Union[ndarray, DatetimeIndex]", variable has type "Index") - final_pd_index = _set_tz(new_pd_index, self.tz) + final_pd_index = _set_tz(new_pd_index, self.tz) return final_pd_index, final_pd_index def take_data(self): From c4db660236a31ea0d97b6e7de442bfcae919cc32 Mon Sep 17 00:00:00 2001 From: prithvijitguha Date: Wed, 17 Nov 2021 21:12:18 +0530 Subject: [PATCH 3/3] pre commit fix --- pandas/io/pytables.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py index 267c04d212082..eedf00bcd9c76 100644 --- a/pandas/io/pytables.py +++ b/pandas/io/pytables.py @@ -2093,9 +2093,6 @@ 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") final_pd_index = _set_tz(new_pd_index, self.tz) return final_pd_index, final_pd_index