Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADAP-464: Add allow_non_incremental_definition option to BigQuery materialized views #1011

Closed
wants to merge 10 commits into from
1 change: 1 addition & 0 deletions dbt/adapters/bigquery/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class BigqueryConfig(AdapterConfig):
enable_refresh: Optional[bool] = None
refresh_interval_minutes: Optional[int] = None
max_staleness: Optional[str] = None
allow_non_incremental_definition: Optional[bool] = None


class BigQueryAdapter(BaseAdapter):
Expand Down
5 changes: 5 additions & 0 deletions dbt/adapters/bigquery/relation_configs/_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class BigQueryOptionsConfig(BigQueryBaseRelationConfig):
refresh_interval_minutes: Optional[float] = 30
expiration_timestamp: Optional[datetime] = None
max_staleness: Optional[str] = None
allow_non_incremental_definition: Optional[bool] = None
mikealfare marked this conversation as resolved.
Show resolved Hide resolved
kms_key_name: Optional[str] = None
description: Optional[str] = None
labels: Optional[Dict[str, str]] = None
Expand Down Expand Up @@ -57,6 +58,7 @@ def array(x):
"refresh_interval_minutes": numeric,
"expiration_timestamp": interval,
"max_staleness": interval,
"allow_non_incremental_definition": boolean,
"kms_key_name": string,
"description": escaped_string,
"labels": array,
Expand Down Expand Up @@ -84,6 +86,7 @@ def from_dict(cls, config_dict: Dict[str, Any]) -> "BigQueryOptionsConfig":
"refresh_interval_minutes": float_setting,
"expiration_timestamp": None,
"max_staleness": None,
"allow_non_incremental_definition": bool_setting,
"kms_key_name": None,
"description": None,
"labels": None,
Expand Down Expand Up @@ -114,6 +117,7 @@ def parse_model_node(cls, model_node: ModelNode) -> Dict[str, Any]:
"refresh_interval_minutes",
"expiration_timestamp",
"max_staleness",
"allow_non_incremental_definition",
"kms_key_name",
"description",
"labels",
Expand All @@ -137,6 +141,7 @@ def parse_bq_table(cls, table: BigQueryTable) -> Dict[str, Any]:
"refresh_interval_minutes": table.mview_refresh_interval.seconds / 60,
"expiration_timestamp": table.expires,
"max_staleness": None,
"allow_non_incremental_definition": table._properties.get("materializedView", {}).get("allowNonIncrementalDefinition"),
mikealfare marked this conversation as resolved.
Show resolved Hide resolved
"description": table.description,
}

Expand Down