Tag operation nodes with their hook type - #16319
Open
CallumFriend-MP wants to merge 3 commits into
Open
CallumFriend-MP wants to merge 3 commits into
CallumFriend-MP wants to merge 3 commits into
Conversation
`on-run-start`/`on-run-end` operation nodes were built with `..Default::default()` for `tags`, so they reached the manifest with `tags: []`. dbt-core tags each hook with its own hook type, which is what makes `--select tag:on-run-start` reach them. `operation_type` is already threaded into `new_operation` for the node name and fqn, so the tag comes from the same value. Fixes dbt-labs#16315 in part. That issue also covers `config` being absent from these nodes entirely; dbt-core emits a fully resolved node config there, which would require operations to participate in config resolution — left out here as a separate decision. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
CallumFriend-MP
force-pushed
the
callumfriend/operation-tags
branch
from
September 15, 2026 16:49
3667a0c to
2504665
Compare
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #16315 in part.
on-run-startandon-run-endoperation nodes reach the manifest withtags: []. dbt-core tags each hook with its own hook type, which is what lets--select tag:on-run-startfind them.new_operationbuildsCommonAttributeswith..Default::default(), sotagsnever got set.operation_typeis already a parameter and already used for the nodenameandfqn, so the tag comes from the same value. No new plumbing.Verification
cargo check -p dbt-parseris clean.cargo test -p dbt-parser --libgives 398 passed, 0 failed, 5 ignored, includingresolve::resolve_operations::tests::dependency_package_hook_reads_root_project_name.I also built a binary from this branch and ran it against a project with
on-run-start: ["select 1"]:Stock 2.0.0rc2 gives
tags: []on the same project. dbt-core 1.12.0 gives['on-run-start'].One test fails that isn't mine: the
--doctestresolve::validate_metrics::validate_metric_name(line 43) fails withE0432: unresolved import dbt_parser::resolve::validate_metric_name. I checked it against pristinemainwith my change reverted and it fails there identically.Not included
#16315 also covers
configbeing absent fromoperation.*nodes. dbt-core writes a fully resolved node config there:enabled,materialized: view,on_schema_change, project-level defaults likerequire_partition_filter, and so on.That's a bigger change than this one.
DbtOperationhas no config field, and bothserialized_config()andhas_same_config()say operations have no config by design, so matching dbt-core means operations take part in config resolution. That seemed like your call rather than something to fold into a one-line PR, so I left it out and wrote it up on the issue.It's also the half that actually bites. Manifest consumers that loop over every node and read
node['config']get aKeyErroron these.