Skip to content

Commit bcdd8c8

Browse files
committed
fixes job log exception message
1 parent 7f1f76f commit bcdd8c8

File tree

5 files changed

+8
-10
lines changed

5 files changed

+8
-10
lines changed

dlt/common/destination/capabilities.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class DestinationCapabilitiesContext(ContainerInjectableContext):
7676
# use naming convention in the schema
7777
naming_convention: TNamingConventionReferenceArg = None
7878
alter_add_multi_column: bool = True
79-
create_table_not_exists: bool = True
79+
supports_create_table_if_not_exists: bool = True
8080
supports_truncate_command: bool = True
8181
schema_supports_numeric_precision: bool = True
8282
timestamp_precision: int = 6

dlt/common/destination/reference.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -383,16 +383,12 @@ def run_managed(
383383
except (DestinationTerminalException, TerminalValueError) as e:
384384
self._state = "failed"
385385
self._exception = e
386-
logger.exception(
387-
f"Terminal exception in job {self.job_id()} on table {self.load_table_name} in file"
388-
f" {self._file_path}"
389-
)
386+
logger.exception(f"Terminal exception in job {self.job_id()} in file {self._file_path}")
390387
except (DestinationTransientException, Exception) as e:
391388
self._state = "retry"
392389
self._exception = e
393390
logger.exception(
394-
f"Transient exception in job {self.job_id()} on table {self.load_table_name} in"
395-
f" file {self._file_path}"
391+
f"Transient exception in job {self.job_id()} in file {self._file_path}"
396392
)
397393
finally:
398394
self._finished_at = pendulum.now()

dlt/destinations/impl/mssql/factory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def _raw_capabilities(self) -> DestinationCapabilitiesContext:
3737
caps.max_text_data_type_length = 2**30 - 1
3838
caps.is_max_text_data_type_length_in_bytes = False
3939
caps.supports_ddl_transactions = True
40-
caps.create_table_not_exists = False # IF NOT EXISTS not supported
40+
caps.supports_create_table_if_not_exists = False # IF NOT EXISTS not supported
4141
caps.max_rows_per_insert = 1000
4242
caps.timestamp_precision = 7
4343
caps.supported_merge_strategies = ["delete-insert", "upsert", "scd2"]

dlt/destinations/impl/synapse/factory.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ def _raw_capabilities(self) -> DestinationCapabilitiesContext:
6363
caps.supports_transactions = True
6464
caps.supports_ddl_transactions = False
6565

66-
caps.create_table_not_exists = False # IF NOT EXISTS on CREATE TABLE not supported
66+
caps.supports_create_table_if_not_exists = (
67+
False # IF NOT EXISTS on CREATE TABLE not supported
68+
)
6769

6870
# Synapse throws "Some part of your SQL statement is nested too deeply. Rewrite the query or break it up into smaller queries."
6971
# if number of records exceeds a certain number. Which exact number that is seems not deterministic:

dlt/destinations/job_client_impl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ def _make_create_table(self, qualified_name: str, table: TTableSchema) -> str:
526526
not_exists_clause = " "
527527
if (
528528
table["name"] in self.schema.dlt_table_names()
529-
and self.capabilities.create_table_not_exists
529+
and self.capabilities.supports_create_table_if_not_exists
530530
):
531531
not_exists_clause = " IF NOT EXISTS "
532532
return f"CREATE TABLE{not_exists_clause}{qualified_name}"

0 commit comments

Comments
 (0)