@@ -243,14 +243,14 @@ def test_categorical_consistency(s1, categorize):
243
243
tm .assert_series_equal (h1 , h3 )
244
244
245
245
246
- def test_categorical_with_nan_consistency (unit ):
247
- dti = pd .date_range ( "2012-01-01" , periods = 5 , name = "B" , unit = unit )
248
- cat = pd . Categorical . from_codes ( [- 1 , 0 , 1 , 2 , 3 , 4 ], categories = dti )
249
- expected = hash_array ( cat , categorize = False )
250
-
251
- ts = pd . Timestamp ( "2012-01-01" ). as_unit ( unit )
252
- cat2 = pd .Categorical .from_codes ([- 1 , 0 ], categories = [ts ])
253
- result = hash_array (cat2 , categorize = False )
246
+ def test_categorical_with_nan_consistency ():
247
+ c = pd .Categorical . from_codes (
248
+ [- 1 , 0 , 1 , 2 , 3 , 4 ], categories = pd . date_range ( "2012-01-01" , periods = 5 , name = "B" )
249
+ )
250
+ expected = hash_array ( c , categorize = False )
251
+
252
+ c = pd .Categorical .from_codes ([- 1 , 0 ], categories = [pd . Timestamp ( "2012-01-01" ) ])
253
+ result = hash_array (c , categorize = False )
254
254
255
255
assert result [0 ] in expected
256
256
assert result [1 ] in expected
0 commit comments