Skip to content

Commit

Permalink
bugfix/writing-complete-df
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lautarortega authored Jan 9, 2025
1 parent ad9f1eb commit 19635ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion awswrangler/athena/_write_iceberg.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ def to_iceberg(

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

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

0 comments on commit 19635ce

Please sign in to comment.