Skip to content

Commit

Permalink
Update SQLQuery to include node_info (#936)
Browse files Browse the repository at this point in the history
* use dynamic schema in test_grant_access_to.py

* use dynamic schema in test_grant_access_to.py

* update SQLQuery to include node_info

* add changie

* revert setup
  • Loading branch information
colin-rogers-dbt authored Sep 22, 2023
1 parent 9f6c449 commit 4c02c07
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changes/unreleased/Under the Hood-20230922-114217.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Under the Hood
body: update SQLQuery to include node_info
time: 2023-09-22T11:42:17.770033-07:00
custom:
Author: colin-rogers-dbt
Issue: "936"
4 changes: 3 additions & 1 deletion dbt/adapters/bigquery/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from contextlib import contextmanager
from dataclasses import dataclass, field

from dbt.events.contextvars import get_node_info
from mashumaro.helper import pass_through

from functools import lru_cache
Expand Down Expand Up @@ -444,7 +445,8 @@ def raw_execute(
conn = self.get_thread_connection()
client = conn.handle

fire_event(SQLQuery(conn_name=conn.name, sql=sql))
fire_event(SQLQuery(conn_name=conn.name, sql=sql, node_info=get_node_info()))

if (
hasattr(self.profile, "query_comment")
and self.profile.query_comment
Expand Down

0 comments on commit 4c02c07

Please sign in to comment.