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:
1091
1091
_check_schema_compatible (table_schema_simple , other_schema )
1092
1092
1093
1093
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
+
1094
1108
def test_table_properties (example_table_metadata_v2 : Dict [str , Any ]) -> None :
1095
1109
# metadata properties are all strings
1096
1110
for k , v in example_table_metadata_v2 ["properties" ].items ():
You can’t perform that action at this time.
0 commit comments