Skip to content

Commit

Permalink
pipe the behavior through to relation in a temporary way to help with…
Browse files Browse the repository at this point in the history
… warnings in cli
  • Loading branch information
VersusFacit committed Sep 17, 2024
1 parent 49623d7 commit 4ede1ee
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions dbt/adapters/snowflake/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ class SnowflakeAdapter(SQLAdapter):
}
)

def __init__(self, config, mp_context):
super().__init__(config, mp_context)
# Patch to pass behavior through to Relation. This is ideally not how we should do this
# but the ideal solution requires patches to dbt-adapters.
self.Relation.behavior = self.behavior

@property
def _behavior_flags(self) -> List[BehaviorFlag]:
return [{"name": "enable_iceberg_materializations", "default": False}]
Expand Down
6 changes: 5 additions & 1 deletion dbt/adapters/snowflake/relation.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ def is_dynamic_table(self) -> bool:

@property
def is_iceberg_format(self) -> bool:
return self.table_format == TableFormat.ICEBERG
# this is a hack to minimize exposure of the iceberg behavior flag warning
return (
self.table_format == TableFormat.ICEBERG
and self.behavior.enable_iceberg_materializations
)

@classproperty
def DynamicTable(cls) -> str:
Expand Down

0 comments on commit 4ede1ee

Please sign in to comment.