Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions sqlmesh/integrations/dlt.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,7 @@ def generate_incremental_model(

def format_config(configs: t.Dict[str, str], db_type: str) -> str:
"""Generate a string for the gateway connection config."""
config = {
"type": db_type,
}
config: t.Dict[str, t.Any] = {}

for key, value in configs.items():
if key == "password":
Expand All @@ -226,6 +224,11 @@ def format_config(configs: t.Dict[str, str], db_type: str) -> str:
else:
config[key] = value

# Set db_type after iterating credentials so that credential attributes
# with a conflicting name (e.g. GCP service-account JSON contains
# "type": "service_account") cannot overwrite the connection type.
config["type"] = db_type

# Validate the connection config fields
invalid_fields = []
try:
Expand Down
2 changes: 1 addition & 1 deletion tests/cli/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1020,8 +1020,8 @@ def test_dlt_pipeline(runner, tmp_path):
gateways:
duckdb:
connection:
type: duckdb
database: {dataset_path}
type: duckdb
default_gateway: duckdb

# --- Model Defaults ---
Expand Down