Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20260303-101430.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: Fix TimingInfoCollected event (Z010) never fired in compile_and_execute
time: 2026-03-03T10:14:30.8243287Z
custom:
Author: kalluripradeep
Issue: "12581"
7 changes: 7 additions & 0 deletions core/dbt/task/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from dbt.contracts.graph.manifest import Manifest
from dbt.events.types import (
CatchableExceptionOnRun,
TimingInfoCollected,
GenericExceptionOnRun,
InternalErrorOnRun,
LogDbtProfileError,
Expand Down Expand Up @@ -298,6 +299,9 @@ def compile_and_execute(self, manifest: Manifest, ctx: ExecutionContext):
# this has the benefit of showing a build path for the errant
# model. This calls the 'compile' method in CompileTask
ctx.node = self.compile(manifest)
fire_event(
TimingInfoCollected(node_info=ctx.node.node_info, timing_info=ctx.timing[-1])
)

# for ephemeral nodes, we only want to compile, not run
if not ctx.node.is_ephemeral_model or self.run_ephemeral_models:
Expand All @@ -310,6 +314,9 @@ def compile_and_execute(self, manifest: Manifest, ctx: ExecutionContext):
with collect_timing_info("execute", ctx.timing.append):
result = self.run(ctx.node, manifest)
ctx.node = result.node
fire_event(
TimingInfoCollected(node_info=ctx.node.node_info, timing_info=ctx.timing[-1])
)

return result

Expand Down
4 changes: 4 additions & 0 deletions tests/functional/logging/test_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def models():
def test_basic(project, logs_dir):
results = run_dbt(["--log-format=json", "run"])
assert len(results) == 1
timing_info_seen = False
manifest = get_manifest(project.project_root)
assert "model.test.my_model" in manifest.nodes

Expand Down Expand Up @@ -59,6 +60,9 @@ def test_basic(project, logs_dir):
if log_event == "TimingInfoCollected":
assert "node_info" in log_data
assert "timing_info" in log_data
timing_info_seen = True

assert timing_info_seen, "TimingInfoCollected event was never fired"

# windows doesn't have the same thread/connection flow so the ConnectionReused
# events don't show up
Expand Down