Skip to content

fix: emit per-model log lines for dbt clone#4

Open
claygeo wants to merge 1 commit intomainfrom
fix/clone-output-useful-log-info
Open

fix: emit per-model log lines for dbt clone#4
claygeo wants to merge 1 commit intomainfrom
fix/clone-output-useful-log-info

Conversation

@claygeo
Copy link
Copy Markdown
Owner

@claygeo claygeo commented Mar 30, 2026

Summary

Fixes dbt-labs#9501

dbt clone ran completely silent — no per-model output, no way to tell which models were being cloned vs skipped as no-ops, and no visibility into errors until the end-of-run summary.

This adds before_execute / after_execute implementations to CloneRunner following the same pattern as ModelRunner:

  • START line when each model begins cloning
  • Result line when it finishes, showing:
    • The adapter response (e.g. CREATE TABLE) when a clone was created
    • No-op when the relation already matched the source
    • Error details at ERROR level when cloning failed

Before:

Running with dbt=1.9.0
...
Done. PASS=42 WARN=0 ERROR=0 SKIP=0 TOTAL=42

After:

Running with dbt=1.9.0
Concurrency: 4 threads (target='dev')

1 of 42 START clone model.my_pkg.model_a ................ [RUN]
1 of 42 OK clone model.my_pkg.model_a ................... [No-op in 0.23s]
2 of 42 START clone model.my_pkg.model_b ................ [RUN]
2 of 42 OK clone model.my_pkg.model_b ................... [CREATE TABLE in 0.41s]
...
Done. PASS=42 WARN=0 ERROR=0 SKIP=0 TOTAL=42

Test plan

  • python -m pytest tests/unit/task/test_clone.py -v — 5 tests pass
  • Manual: run dbt clone --state ./prod-artifacts and verify per-model output appears

dbt clone ran silently — no per-model START or result output. Users had no
way to tell which models were cloned vs no-ops, or which failed, until the
summary at the end.

Adds before_execute/after_execute implementations to CloneRunner following
the same pattern as ModelRunner: fires LogStartLine at start and
LogModelResult at finish, showing the adapter response ("CREATE TABLE") or
"No-op" when the relation was already current.

Closes dbt-labs#9501
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] DBT clone should output more useful information to the log

1 participant