@@ -1540,6 +1540,14 @@ def test_type_string_to_type_object_array_of_decimal():
15401540 assert dt .element_type .precision == 10
15411541 assert dt .element_type .scale == 2
15421542
1543+ try :
1544+ type_string_to_type_object ("array<decimal(10,2>" )
1545+ raise AssertionError ("Expected ValueError for not a supported type" )
1546+ except ValueError as ex :
1547+ assert "is not a supported type" in str (
1548+ ex
1549+ ), f"Expected not a supported type, got: { ex } "
1550+
15431551
15441552def test_type_string_to_type_object_map_of_int_string ():
15451553 dt = type_string_to_type_object ("map<int, string>" )
@@ -1720,7 +1728,7 @@ def test_type_string_to_type_object_implicit_struct_with_spaces():
17201728 Test spacing variations. E.g. " col1 : int , col2 : map< string , decimal(5,2) > ".
17211729 """
17221730 dt = type_string_to_type_object (
1723- " col1 : int , col2 : map< string , decimal(5,2 ) > "
1731+ " col1 : int , col2 : map< string , decimal( 5 , 2 ) > "
17241732 )
17251733 assert isinstance (dt , StructType ), f"Expected StructType, got { dt } "
17261734 assert len (dt .fields ) == 2 , f"Expected 2 fields, got { len (dt .fields )} "
0 commit comments