Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrockmendel committed Nov 15, 2023
1 parent 7689999 commit 5e74906
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pandas/tests/util/test_hashing.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,14 @@ def test_categorical_consistency(s1, categorize):
tm.assert_series_equal(h1, h3)


def test_categorical_with_nan_consistency(unit):
dti = pd.date_range("2012-01-01", periods=5, name="B", unit=unit)
cat = pd.Categorical.from_codes([-1, 0, 1, 2, 3, 4], categories=dti)
expected = hash_array(cat, categorize=False)

ts = pd.Timestamp("2012-01-01").as_unit(unit)
cat2 = pd.Categorical.from_codes([-1, 0], categories=[ts])
result = hash_array(cat2, categorize=False)
def test_categorical_with_nan_consistency():
c = pd.Categorical.from_codes(
[-1, 0, 1, 2, 3, 4], categories=pd.date_range("2012-01-01", periods=5, name="B")
)
expected = hash_array(c, categorize=False)

c = pd.Categorical.from_codes([-1, 0], categories=[pd.Timestamp("2012-01-01")])
result = hash_array(c, categorize=False)

assert result[0] in expected
assert result[1] in expected
Expand Down

0 comments on commit 5e74906

Please sign in to comment.