Skip to content

Commit 449052a

Browse files
committed
Omit external volume from DDL when not provided
1 parent 5d935ee commit 449052a

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

dbt/adapters/snowflake/relation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,11 @@ def get_iceberg_ddl_options(self, config: RelationConfig) -> str:
213213
base_location += f"/{subpath}"
214214

215215
iceberg_ddl_predicates: str = f"""
216-
external_volume = '{config.get('external_volume')}'
217216
catalog = 'snowflake'
218217
base_location = '{base_location}'
219218
"""
219+
if external_volume := config.get("external_volume"):
220+
iceberg_ddl_predicates += f"\nexternal_volume = '{external_volume}'"
220221
return textwrap.indent(textwrap.dedent(iceberg_ddl_predicates), " " * 10)
221222

222223
def __drop_conditions(self, old_relation: "SnowflakeRelation") -> Iterator[Tuple[bool, str]]:

dbt/adapters/snowflake/relation_configs/catalog.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ def from_dict(cls, config_dict: Dict[str, Any]) -> Self:
6666
}
6767
if table_format := config_dict.get("table_format"):
6868
kwargs_dict["table_format"] = TableFormat(table_format)
69+
if external_volume := config_dict.get("external_volume"):
70+
kwargs_dict["external_volume"] = external_volume
6971
return super().from_dict(kwargs_dict)
7072

7173
@classmethod

0 commit comments

Comments
 (0)