@@ -666,7 +666,11 @@ def test_upsert_with_struct_field_as_join_key(catalog: Catalog) -> None:
666666 )
667667
668668 with pytest .raises (
669- ValueError , match = "Nested column 'nested_type' of type 'struct<sub1: large_string not null, sub2: large_string not null>' cannot be used as a join key in upsert"
669+ ValueError ,
670+ match = (
671+ "Nested column 'nested_type' of type 'struct<sub1: large_string not null, sub2: large_string not null>' "
672+ "cannot be used as a join key in upsert"
673+ ),
670674 ):
671675 _ = tbl .upsert (update_data , join_cols = ["nested_type" ])
672676
@@ -889,14 +893,27 @@ def test_upsert_snapshot_properties(catalog: Catalog) -> None:
889893 assert snapshot .summary is not None
890894 assert snapshot .summary .additional_properties .get ("test_prop" ) == "test_value"
891895
896+
892897@pytest .mark .parametrize (
893898 "arrow_type, expected_error, match" ,
894899 [
895900 (pa .float32 (), ValueError , "Floating point column 'k' cannot be used as a join key in upsert" ),
896901 (pa .float64 (), ValueError , "Floating point column 'k' cannot be used as a join key in upsert" ),
897- (pa .struct ([("a" , pa .int32 ())]), ValueError , "Nested column 'k' of type 'struct<a: int32>' cannot be used as a join key in upsert" ),
898- (pa .list_ (pa .int32 ()), ValueError , "Nested column 'k' of type 'list<item: int32>' cannot be used as a join key in upsert" ),
899- (pa .dictionary (pa .int32 (), pa .string ()), NotImplementedError , "Dictionary-encoded column 'k' is not currently supported as a join key in upsert" ),
902+ (
903+ pa .struct ([("a" , pa .int32 ())]),
904+ ValueError ,
905+ "Nested column 'k' of type 'struct<a: int32>' cannot be used as a join key in upsert" ,
906+ ),
907+ (
908+ pa .list_ (pa .int32 ()),
909+ ValueError ,
910+ "Nested column 'k' of type 'list<item: int32>' cannot be used as a join key in upsert" ,
911+ ),
912+ (
913+ pa .dictionary (pa .int32 (), pa .string ()),
914+ NotImplementedError ,
915+ "Dictionary-encoded column 'k' is not currently supported as a join key in upsert" ,
916+ ),
900917 (pa .null (), ValueError , "Null-type column 'k' cannot be used as a join key in upsert" ),
901918 (pa .uuid (), NotImplementedError , "is not currently supported as a join key in upsert" ),
902919 ],
@@ -911,7 +928,7 @@ def test_upsert_unsupported_join_column_types(
911928 catalog .drop_table (identifier )
912929 except NoSuchTableError :
913930 pass
914-
931+
915932 # Define the table schema to be compatible with the arrow_type but still trigger our check
916933 if pa .types .is_dictionary (arrow_type ):
917934 table_type = pa .string ()
0 commit comments