Skip to content

Commit bf32a80

Browse files
committed
TST: Replace from_codes
Closes pandas-dev#27955
1 parent 1b0a444 commit bf32a80

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pandas/tests/io/test_parquet.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -457,8 +457,10 @@ def test_categorical(self, pa):
457457
df["a"] = pd.Categorical(list("abcdef"))
458458

459459
# test for null, out-of-order values, and unobserved category
460-
dtype = pd.CategoricalDtype(["foo", "bar", "baz"])
461-
df["b"] = pd.Categorical.from_codes(codes=[1, 0, 0, 1, -1, 1], dtype=dtype)
460+
df["b"] = pd.Categorical(
461+
["bar", "foo", "foo", "bar", None, "bar"],
462+
dtype=pd.CategoricalDtype(["foo", "bar", "baz"]),
463+
)
462464

463465
# test for ordered flag
464466
df["c"] = pd.Categorical(

0 commit comments

Comments
 (0)