Skip to content

Commit

Permalink
fix iceberg detection
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-rp committed Oct 4, 2023
1 parent 119ad6e commit bd5527b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dlt/destinations/athena/athena.py
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand All @@ -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
Expand Down

0 comments on commit bd5527b

Please sign in to comment.