Skip to content

Commit

Permalink
feat(core): drop default value for write disposition
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyaFaer committed Mar 6, 2024
1 parent 483d4ae commit afbf4ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dlt/common/schema/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ def new_table(
assert schema_contract is None
else:
# set write disposition only for root tables
table["write_disposition"] = write_disposition or DEFAULT_WRITE_DISPOSITION
table["write_disposition"] = write_disposition
table["resource"] = resource or table_name
if schema_contract is not None:
table["schema_contract"] = schema_contract
Expand Down
3 changes: 2 additions & 1 deletion tests/extract/test_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,7 @@ def empty_gen():
"name": "empty_gen",
"columns": {},
"resource": "empty_gen",
"write_disposition": "append",
"write_disposition": None,
}

empty = DltResource.from_data(empty_gen)
Expand Down Expand Up @@ -1251,6 +1251,7 @@ def empty_gen():
assert table["name"] == "empty_gen"
assert "parent" not in table
assert table["columns"] == {}
empty_table_schema["write_disposition"] = "append"
assert empty_r.compute_table_schema() == empty_table_schema

# combine columns with primary key
Expand Down

0 comments on commit afbf4ec

Please sign in to comment.