Skip to content

Commit

Permalink
add warning message for merge without merge keys
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-rp committed Mar 26, 2024
1 parent af9a6c3 commit 4291338
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions dlt/common/destination/reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,16 @@ def _verify_schema(self) -> None:
table_name,
self.capabilities.max_identifier_length,
)
if (
table.get("write_disposition") == "merge"
and (not has_column_with_prop(table, "primary_key"))
and (not has_column_with_prop(table, "merge_key"))
):
logger.warning(
f'Table "{table_name}" in schema "{self.schema.name}" has write disposition'
' "merge" but no primary key or merge keys specified. Loader will fall back to'
' "append" write disposition for this table.'
)
if has_column_with_prop(table, "hard_delete"):
if len(get_columns_names_with_prop(table, "hard_delete")) > 1:
raise SchemaException(
Expand Down

0 comments on commit 4291338

Please sign in to comment.