Skip to content

Commit

Permalink
Merge pull request #404 from jefersonmsantos/main
Browse files Browse the repository at this point in the history
Resetting invocation_context on generate_sql function when dbt_version > 1.8
  • Loading branch information
popcornylu authored Aug 22, 2024
2 parents cbbfbff + 2edaaad commit a4c9d5e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions recce/adapter/dbt_adapter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,10 @@ def generate_sql(self, sql_template: str, base: bool = False, context: Dict = {}
manifest = as_manifest(self.get_manifest(base))
parser = SqlBlockParser(self.runtime_config, manifest, self.runtime_config)

if dbt_version >= dbt_version.parse('v1.8'):
from dbt_common.context import set_invocation_context
set_invocation_context({})

node_id = str("generated_" + uuid.uuid4().hex)
node = parser.parse_remote(sql_template, node_id)
process_node(self.runtime_config, manifest, node)
Expand Down

0 comments on commit a4c9d5e

Please sign in to comment.