Skip to content

Commit 19635ce

Browse files
authored
bugfix/writing-complete-df
Using the catalog columns only meant the new columns were being dropped. This caused the insert into statements to fail to write data for new columns.
1 parent ad9f1eb commit 19635ce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

awswrangler/athena/_write_iceberg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ def to_iceberg(
546546

547547
# Ensure that the ordering of the DF is the same as in the catalog.
548548
# This is required for the INSERT command to work.
549-
df = df[catalog_cols]
549+
df = df[catalog_cols + list(schema_differences["new_columns"].keys())]
550550

551551
if schema_evolution is False and any([schema_differences[x] for x in schema_differences]): # type: ignore[literal-required]
552552
raise exceptions.InvalidArgumentValue(f"Schema change detected: {schema_differences}")

0 commit comments

Comments
 (0)