Skip to content

Commit 65fd00a

Browse files
committed
rewrite test_table_write_out_of_order_schema
1 parent a4a7064 commit 65fd00a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

tests/integration/test_writes/test_writes.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -929,12 +929,13 @@ def test_table_write_subset_of_schema(session_catalog: Catalog, arrow_table_with
929929

930930
@pytest.mark.parametrize("format_version", [1, 2])
931931
def test_table_write_out_of_order_schema(session_catalog: Catalog, arrow_table_with_null: pa.Table, format_version: int) -> None:
932-
import random
933-
934932
identifier = "default.test_table_write_out_of_order_schema"
935-
shuffled_schema = pa.schema(random.shuffle(arrow_table_with_null.schema))
936-
937-
tbl = _create_table(session_catalog, identifier, {"format-version": format_version}, schema=shuffled_schema)
933+
# rotate the schema fields by 1
934+
fields = list(arrow_table_with_null.schema)
935+
rotated_fields = fields[1:] + fields[:1]
936+
rotated_schema = pa.schema(rotated_fields)
937+
assert arrow_table_with_null.schema != rotated_schema
938+
tbl = _create_table(session_catalog, identifier, {"format-version": format_version}, schema=rotated_schema)
938939

939940
tbl.overwrite(arrow_table_with_null)
940941
tbl.append(arrow_table_with_null)

0 commit comments

Comments
 (0)