Skip to content

Commit

Permalink
Parse maxStaleness
Browse files Browse the repository at this point in the history
  • Loading branch information
bnaul committed Nov 12, 2023
1 parent 97332e6 commit e75ccac
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dbt/adapters/bigquery/relation_configs/_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,11 @@ def parse_bq_table(cls, table: BigQueryTable) -> Dict[str, Any]:
"enable_refresh": table.mview_enable_refresh,
"refresh_interval_minutes": table.mview_refresh_interval.seconds / 60,
"expiration_timestamp": table.expires,
"max_staleness": None,
"max_staleness": (
f"INTERVAL '{table._properties.get('maxStaleness')}' YEAR TO SECOND"
if table._properties.get('maxStaleness')
else None
),
"allow_non_incremental_definition": table._properties.get("materializedView", {}).get("allowNonIncrementalDefinition"),
"description": table.description,
}
Expand Down

0 comments on commit e75ccac

Please sign in to comment.