From bd5527ba66f3df6d5f867901ba8f9172c9b12807 Mon Sep 17 00:00:00 2001 From: Dave Date: Wed, 4 Oct 2023 10:21:02 +0200 Subject: [PATCH] fix iceberg detection --- dlt/destinations/athena/athena.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlt/destinations/athena/athena.py b/dlt/destinations/athena/athena.py index 30c3b7e907..835c5c19e2 100644 --- a/dlt/destinations/athena/athena.py +++ b/dlt/destinations/athena/athena.py @@ -308,10 +308,10 @@ def _get_column_def_sql(self, c: TColumnSchema) -> str: def _get_table_update_sql(self, table_name: str, new_columns: Sequence[TColumnSchema], generate_alter: bool) -> List[str]: - create_only_iceberg_tables = self.config.iceberg_bucket_url is not None and not self.in_staging_mode + iceberg_only_mode = self.config.iceberg_bucket_url and not self.in_staging_mode bucket = self.config.staging_config.bucket_url - if create_only_iceberg_tables: + if iceberg_only_mode: bucket = self.config.iceberg_bucket_url # TODO: we need to strip the staging layout from the table name, find a better way! @@ -320,7 +320,7 @@ def _get_table_update_sql(self, table_name: str, new_columns: Sequence[TColumnSc # for the system tables we need to create empty iceberg tables to be able to run, DELETE and UPDATE queries # or if we are in iceberg mode, we create iceberg tables for all tables - is_iceberg = (self.schema.tables[table_name].get("write_disposition", None) == "skip") or create_only_iceberg_tables + is_iceberg = (self.schema.tables[table_name].get("write_disposition", None) == "skip") or iceberg_only_mode columns = ", ".join([self._get_column_def_sql(c) for c in new_columns]) # this will fail if the table prefix is not properly defined