From 0fd3c66cfbcb14b776cdd1c2bcb977ac0293056d Mon Sep 17 00:00:00 2001 From: nickleus27 Date: Mon, 8 Nov 2021 14:48:45 -0800 Subject: [PATCH 1/2] changed variable hashed to combined_hashed in dtype.py --- pandas/core/dtypes/dtypes.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pandas/core/dtypes/dtypes.py b/pandas/core/dtypes/dtypes.py index 21675ca0cdc7c..98121bf06b542 100644 --- a/pandas/core/dtypes/dtypes.py +++ b/pandas/core/dtypes/dtypes.py @@ -468,12 +468,10 @@ def _hash_categories(self) -> int: # error: Incompatible types in assignment (expression has type # "List[ndarray]", variable has type "ndarray") cat_array = [cat_array] # type: ignore[assignment] - # error: Incompatible types in assignment (expression has type "ndarray", - # variable has type "int") - hashed = combine_hash_arrays( # type: ignore[assignment] + combined_hashed = combine_hash_arrays( iter(cat_array), num_items=len(cat_array) ) - return np.bitwise_xor.reduce(hashed) + return np.bitwise_xor.reduce(combined_hashed) @classmethod def construct_array_type(cls) -> type_t[Categorical]: From c3e784f9470bfa6d4ea7763b3c099e7c75ef6296 Mon Sep 17 00:00:00 2001 From: nickleus27 Date: Mon, 8 Nov 2021 19:28:16 -0800 Subject: [PATCH 2/2] pre-commit changes --- pandas/core/dtypes/dtypes.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pandas/core/dtypes/dtypes.py b/pandas/core/dtypes/dtypes.py index 98121bf06b542..e20670893f71c 100644 --- a/pandas/core/dtypes/dtypes.py +++ b/pandas/core/dtypes/dtypes.py @@ -468,9 +468,7 @@ def _hash_categories(self) -> int: # error: Incompatible types in assignment (expression has type # "List[ndarray]", variable has type "ndarray") cat_array = [cat_array] # type: ignore[assignment] - combined_hashed = combine_hash_arrays( - iter(cat_array), num_items=len(cat_array) - ) + combined_hashed = combine_hash_arrays(iter(cat_array), num_items=len(cat_array)) return np.bitwise_xor.reduce(combined_hashed) @classmethod