Skip to content

Commit 6a9b612

Browse files
committed
rewrite test_table_write_out_of_order_schema
1 parent 2c52276 commit 6a9b612

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
@@ -977,12 +977,13 @@ def test_table_write_subset_of_schema(session_catalog: Catalog, arrow_table_with
977977

978978
@pytest.mark.parametrize("format_version", [1, 2])
979979
def test_table_write_out_of_order_schema(session_catalog: Catalog, arrow_table_with_null: pa.Table, format_version: int) -> None:
980-
import random
981-
982980
identifier = "default.test_table_write_out_of_order_schema"
983-
shuffled_schema = pa.schema(random.shuffle(arrow_table_with_null.schema))
984-
985-
tbl = _create_table(session_catalog, identifier, {"format-version": format_version}, schema=shuffled_schema)
981+
# rotate the schema fields by 1
982+
fields = list(arrow_table_with_null.schema)
983+
rotated_fields = fields[1:] + fields[:1]
984+
rotated_schema = pa.schema(rotated_fields)
985+
assert arrow_table_with_null.schema != rotated_schema
986+
tbl = _create_table(session_catalog, identifier, {"format-version": format_version}, schema=rotated_schema)
986987

987988
tbl.overwrite(arrow_table_with_null)
988989
tbl.append(arrow_table_with_null)

0 commit comments

Comments
 (0)