| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…_config
format_config initialises config = {"type": db_type} then iterates all
credential object attributes and writes them into config. BigQuery
service-account credentials carry a "type": "service_account" field
(from the GCP service account JSON format) which overwrites the
"bigquery" key. parse_connection_config then raises:
ConfigError: Unknown connection type 'service_account'
This error fires before model generation starts, even though the direct
caller (generate_dlt_models) discards the connection config entirely.
The bug only surfaces with BigQuery service-account credentials; OAUTH
credentials do not carry a conflicting type field.
Fix: move config["type"] = db_type to after the credential loop so it
cannot be overwritten by credential attributes.
Signed-off-by: Mary Akowe <mary.akowe@madetech.com>
|
Hi @mary-akowe! :) May you please review https://github.com/SQLMesh/sqlmesh/blob/main/CONTRIBUTING.md Some of your tests will fail (e.g., tests/cli/test_cli.py::test_dlt_pipeline) |
Sorry, something went wrong.
Signed-off-by: Mary Akowe <mary.akowe@madetech.com>
|
It seems that you did not follow the contribution instructions. I'm seeing failures for make fast-test |
Sorry, something went wrong.
Hello @mday-io, thanks for getting back on this. I initially ran make fast-tests (after following setup instructions), but did not get any failures come up.
Could you please clarify the errors you are referring? |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
sqlmesh dlt_refresh fails with Error: Unknown connection type 'service_account' when the dlt pipeline uses BigQuery with service-account credentials.
Root cause
format_config initialises config = {"type": db_type} (e.g. "bigquery") then iterates all credential object attributes and writes them into config. BigQuery service-account credentials carry a "type": "service_account" field (from the GCP service account JSON format). This overwrites the "bigquery" key. parse_connection_config then raises:
This error fires before model generation starts, even though the direct caller (generate_dlt_models) discards the connection config entirely — it is the _ in:
The bug only surfaces with BigQuery service-account credentials. OAUTH credentials do not carry a conflicting type field, so anyone who tested dlt_refresh with OAUTH would not have seen it.
Fix
Move config["type"] = db_type to after the credential loop so it cannot be overwritten by credential attributes.
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": config[key] = f'"{value}"' elif key == "username": config["user"] = value else: config[key] = value + config["type"] = db_type + # Validate the connection config fieldsReproduction
Does not affect OAUTH credentials.