Repository navigation
Conversation
After a Databricks dbt job run that succeeded, or whose dbt task passed before a later task failed, fluid apply dropped the error from reading the dbt task's output and reported the contract rules from empty logs: "dbt stopped before running them". It now says the output could not be read, with the error, and that the run page lists each rule, as the failed-task path already did. Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
The per-rule report read any "N of M <STATUS> <word>" line as a test, so "ERROR creating sql table model main.orders" or "SKIP relation main.downstream" gave a status to a test named "creating" or "main". A result now counts only when the name is followed by dbt's padding (dots or the bracketed status), as dbt prints it for a test; a model, seed, snapshot, skipped relation or source freshness line carries more words and is not read. Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
📄 Documentation ReminderThis PR appears to be missing a documentation reference. Our docs live in a separate repo. Please update the PR description with one of:
See the Contributing Guide for details. |
1 task
Collaborator
Author
|
This change now lives in #1188, together with the related dbt and plan changes. |
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.
What and why
After
fluid apply --mode amend-and-buildruns a Databricks dbt job, forge reports each contract rule from the dbt task's output. Two things in that report were wrong:runs/get-output) failed after a run that succeeded, or after the dbt task passed and a later task failed, the error was dropped and the rules were reported from empty logs as "dbt stopped before running them". The report now says the output could not be read, with the (scrubbed, bounded) error, and that the run page lists each rule, as the failed-task path already did. A build with no contract rules prints nothing new.N of M <STATUS> <word>line as a test result, soERROR creating sql table model main.ordersorSKIP relation main.downstreamgave a status to a test namedcreatingormain. A result now counts only when the test name is followed by dbt's padding (dots, or the bracketed status), as dbt prints a test line; model, seed, snapshot, skipped-relation and source freshness lines carry more words and are not read.Borrow
core/dbt/events/types.py: the message formats ofLogTestResult,LogModelResult,LogSeedResult,LogSnapshotResult,SkippingDetails,LogSkipBecauseError,LogFreshnessResult,LogHookEndLineand unit tests (model::v). Every non-test node line carries more words before the padding than a test line.format_fancy_output_linepads the message with dots to a fixed width and then prints[STATUS]; the padding shape is pinned by this repo's existing captured-output tests.build_runners/_databricks_job_run.pyalready reported unread output withdatabricks_enforce.scrub; the new lines reuse it.Validation
tests/build_runners/test_databricks*.py,tests/iac/test_iac_databricks_dbt*.py,tests/iac/test_iac_databricks_jobs*.py,tests/cli/test_apply_databricks*.py): 452 passed, 1 skipped.ripwire --quality-delta(the branch diff applied to a fresh copy of main, where a one-line change exits 0): 7 rows, all pairs of tests: the new tests share the arrange-and-assert shape of their neighbours intests/build_runners/test_databricks_job_run.py. No source function grew or was copied.scripts/mypy_strict.py, license-header and source-fence tests: green.Reviews
SKIP test, names with no dot padding, ANSI colour, CRLF); every model, seed, snapshot, skip, freshness and hook line gives no result. One low note: a result line with nothing after the name no longer parses; dbt never prints that shape._task_outputalways returns a mapping.Known limits
::(singular tests, unit test versions) were never read correctly and are still not read; contract rule tests are namedfluid_dq_<id>, so the rules are unaffected.