File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -1091,6 +1091,20 @@ def test_schema_mismatch_additional_field(table_schema_simple: Schema) -> None:
10911091 _check_schema_compatible (table_schema_simple , other_schema )
10921092
10931093
1094+ def test_schema_downcast (table_schema_simple : Schema ) -> None :
1095+ # large_string type is compatible with string type
1096+ other_schema = pa .schema ((
1097+ pa .field ("foo" , pa .large_string (), nullable = True ),
1098+ pa .field ("bar" , pa .int32 (), nullable = False ),
1099+ pa .field ("baz" , pa .bool_ (), nullable = True ),
1100+ ))
1101+
1102+ try :
1103+ _check_schema_compatible (table_schema_simple , other_schema )
1104+ except Exception :
1105+ pytest .fail ("Unexpected Exception raised when calling `_check_schema`" )
1106+
1107+
10941108def test_table_properties (example_table_metadata_v2 : Dict [str , Any ]) -> None :
10951109 # metadata properties are all strings
10961110 for k , v in example_table_metadata_v2 ["properties" ].items ():
You can’t perform that action at this time.
0 commit comments