You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
github-actionsbot
changed the title
[v1.4] In certain cases, invocation_id is cached between invocations
[CT-2317] [v1.4] In certain cases, invocation_id is cached between invocations
Mar 20, 2023
I do think calling set_invocation_id() between in-process dbt calls will solve the issue.
Also, to fix this issue going forward, and guarantee that programmatic invocations (dbtRunner.invoke()) have distinct values of invocation_id, we should either:
Add a call to set_invocation_id() within setup_event_logger()
Call set_invocation_id() within the preflight decorator, right before/after calling setup_event_logger()
(Think about whether EventManager is the right place for invocation_id() to exist long-term)
jtcohen6
changed the title
[CT-2317] [v1.4] In certain cases, invocation_id is cached between invocations
[CT-2317] invocation_id is cached between invocations in same Python process
Mar 26, 2023
The approach I took was to call set_invocation_id() within preflight. The unit tests show this approach will work for programmatic invocations of dbt through the official API.
Originally reported by @jeremyyeo:
Starting in v1.4,
invocation_id
is now stored onEventManager
:dbt-core/core/dbt/events/eventmgr.py
Line 185 in 65fcbe7
I think we should clear or reset
invocation_id
as part of the steps incleanup_event_logger
:dbt-core/core/dbt/events/functions.py
Lines 269 to 272 in 0ef9931
dbt-core/core/dbt/events/functions.py
Lines 160 to 165 in 0ef9931
Reproduction case
on-run-start
hook with{{ log(invocation_id, info = true) }}
The text was updated successfully, but these errors were encountered: