From 8e2938b22ee67fb5595ac857e6cd03ba17c27efc Mon Sep 17 00:00:00 2001 From: Brayan Alfaro Date: Mon, 4 Aug 2025 18:35:20 -0600 Subject: [PATCH] fix: do not remove new columns values --- awswrangler/athena/_write_iceberg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awswrangler/athena/_write_iceberg.py b/awswrangler/athena/_write_iceberg.py index fabc4d032..b5f05eb57 100644 --- a/awswrangler/athena/_write_iceberg.py +++ b/awswrangler/athena/_write_iceberg.py @@ -548,7 +548,7 @@ def to_iceberg( # noqa: PLR0913 # 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 + [col_name for col_name, _ in schema_differences["new_columns"].items()]] 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}")