Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Commit f139e95

Browse files
authored
Fix refresh syntax, config comparison with empty labels (#983)
* map an empty labels dict to none for comparison * remove drop statement that isn't used * fix refresh statement * add drop materialized view back, it gets called by replace * changelog
1 parent b8af6a6 commit f139e95

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
kind: Fixes
2+
body: Fix refresh syntax, config comparison with empty labels
3+
time: 2023-10-25T22:30:03.0034-04:00
4+
custom:
5+
Author: mikealfare
6+
Issue: "983"

dbt/adapters/bigquery/relation_configs/_options.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,12 @@ def parse_bq_table(cls, table: BigQueryTable) -> Dict[str, Any]:
138138
"expiration_timestamp": table.expires,
139139
"max_staleness": None,
140140
"description": table.description,
141-
"labels": table.labels,
142141
}
142+
143+
# map the empty dict to None
144+
if labels := table.labels:
145+
config_dict.update({"labels": labels})
146+
143147
if encryption_configuration := table.encryption_configuration:
144148
config_dict.update({"kms_key_name": encryption_configuration.kms_key_name})
145149
return config_dict
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{% macro bigquery__refresh_materialized_view(relation) %}
2-
call bq.refresh_materialized_view('{{ relation }}')
2+
call bq.refresh_materialized_view('{{ relation.database }}.{{ relation.schema }}.{{ relation.identifier }}')
33
{% endmacro %}

0 commit comments

Comments
 (0)