File tree 2 files changed +10
-1
lines changed
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ def __init__(
49
49
alias = alias ,
50
50
metadata = metadata ,
51
51
)
52
- self .categories = categories
52
+ self .categories = list ( categories )
53
53
54
54
@property
55
55
def dtype (self ) -> pl .DataType :
Original file line number Diff line number Diff line change @@ -52,3 +52,12 @@ def test_valid_cast(
52
52
schema = create_schema ("test" , {"a" : enum })
53
53
df = df_type (data )
54
54
assert schema .is_valid (df , cast = True ) == valid
55
+
56
+
57
+ @pytest .mark .parametrize ("type1" , [list , tuple ])
58
+ @pytest .mark .parametrize ("type2" , [list , tuple ])
59
+ def test_different_sequences (type1 : type , type2 : type ) -> None :
60
+ allowed = ["a" , "b" ]
61
+ S = create_schema ("test" , {"x" : dy .Enum (type1 (allowed ))})
62
+ df = pl .DataFrame ({"x" : pl .Series (["a" , "b" ], dtype = pl .Enum (type2 (allowed )))})
63
+ S .validate (df )
You can’t perform that action at this time.
0 commit comments