diff --git a/CHANGELOG.md b/CHANGELOG.md index 54f17963..11428fad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - Refactor global state reading ([888](https://github.com/databricks/dbt-databricks/pull/888)) - Switch to relation.render() for string interpolation ([903](https://github.com/databricks/dbt-databricks/pull/903)) +- Ensure retry defaults for PySQL ([907](https://github.com/databricks/dbt-databricks/pull/907)) ## dbt-databricks 1.9.1 (December 16, 2024) diff --git a/dbt/adapters/databricks/credentials.py b/dbt/adapters/databricks/credentials.py index 387d0e76..250e79f6 100644 --- a/dbt/adapters/databricks/credentials.py +++ b/dbt/adapters/databricks/credentials.py @@ -74,8 +74,10 @@ class DatabricksCredentials(Credentials): @classmethod def __pre_deserialize__(cls, data: dict[Any, Any]) -> dict[Any, Any]: data = super().__pre_deserialize__(data) - if "database" not in data: - data["database"] = None + data.setdefault("database", None) + data.setdefault("connection_parameters", {}) + data["connection_parameters"].setdefault("_retry_stop_after_attempts_count", 30) + data["connection_parameters"].setdefault("_retry_delay_max", 60) return data def __post_init__(self) -> None: