File tree Expand file tree Collapse file tree 2 files changed +5
-13
lines changed
tests/expectations_helper_classes Expand file tree Collapse file tree 2 files changed +5
-13
lines changed Original file line number Diff line number Diff line change 77DataFrameLike = Union [PySparkDataFrame , PandasDataFrame ]
88
99
10- class DataFrameType (Enum ):
10+ class DataFrameType (str , Enum ):
1111 """
1212 Enum for DataFrame types.
1313 """
1414
1515 PANDAS = "pandas"
1616 PYSPARK = "pyspark"
17-
18- def __str__ (self ):
19- """
20- Get the name of the DataFrame type.
21- """
22- return self .value
Original file line number Diff line number Diff line change @@ -42,13 +42,11 @@ def test_data_frame_type_enum():
4242 DataFrameType .PYSPARK .value == "pyspark"
4343 ), f"Expected 'pyspark' but got: { DataFrameType .PYSPARK .value } "
4444
45- # Test string representation
45+ # Test string comparison (now works directly!)
46+ assert DataFrameType .PANDAS == "pandas" , "Expected DataFrameType.PANDAS == 'pandas' to be True"
4647 assert (
47- str (DataFrameType .PANDAS ) == "pandas"
48- ), f"Expected 'pandas' but got: { str (DataFrameType .PANDAS )} "
49- assert (
50- str (DataFrameType .PYSPARK ) == "pyspark"
51- ), f"Expected 'pyspark' but got: { str (DataFrameType .PYSPARK )} "
48+ DataFrameType .PYSPARK == "pyspark"
49+ ), "Expected DataFrameType.PYSPARK == 'pyspark' to be True"
5250
5351
5452def test_get_expectation_name ():
You can’t perform that action at this time.
0 commit comments