Repository navigation
Conversation
…' results to Fai taskr run 0177. PR open-metadata#37198 is staged on the 2.0 worktree, uncommitted: it applied cleanly, matches the upstream diff line for line, and the planned tests, import check and ruff checks all pass (237/237 in test_dbt.py).
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Code Review ✅ Approved🟡 Medium risk · Mapping dbt warning results to Failed could misclassify threshold warnings and trigger failed-test reporting or alerts for affected checks. Backports PR #37198 to the 2.0 branch so dbt test results with status VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|



Summary
This backports PR #37198 onto the 2.0 branch so that dbt test results with status warn are ingested as Failed, making 2.0 behave like main. The only functional change is adding
WARN = "warn"toDbtTestFailureEnumin constants.py, which routes warn results through the existing failure branch of_map_dbt_test_statuswith no new code path; the metadata.py change is docstring-only. The remaining changes update three tests in test_dbt.py to assertTestCaseStatus.Failedwith a result value of "0" for warn cases and add the decision record docs/decisions/2026-11-05-dbt-warnings-map-to-failed.md. A reviewer should first look at the one-line constants.py addition, the sole behavior change, and compare the diff against upstream commit 3872389; the cherry-pick applied with no conflicts, matches the upstream diff line for line, and test_dbt.py passes 237/237 with the import and ruff checks passing.Implementer's note: PR #37198 is staged on the 2.0 worktree, uncommitted: it applied cleanly, matches the upstream diff line for line, and the planned tests, import check and ruff checks all pass (237/237 in test_dbt.py).
Plan
HEADis the 2.0 tipfd7a694020b; the source commit3872389cb9a(onfix/dbt-warn-as-failed) is NOT an ancestor ofHEAD. Baseconstants.pyhas noWARNmember inDbtTestFailureEnum(lines 137-144), so the backport is not applied.env/and noingestion/src/metadata/generated/. Use a per-worktree venv or symlink the main checkout's venv (ln -s <main>/.venv env; confirm which directory exists in main first, since CLAUDE.md saysenv/but memory says.venv/). Always invoke withPYTHONPATH=ingestion/srcso the stale site-packages install is not imported.env/bin/python scripts/datamodel_generation.pyandmake py_antlr. Do NOT runmake generate, because its trailing$(MAKE) installrepoints the shared venv.git cherry-pick -x 3872389cb9a3f639554e6e2123e298065afbbc86(not a merge, so no-m). Expected hunks, each verified by reading the base file, so context should match:constants.py: blob56c1feabef1is identical on the parent and on base; addsWARN = "warn"afterERROR = "error".metadata.py: docstring-only hunk at base lines ~2177-2179 (_map_dbt_test_status); base text matches the PR's "before" text. No code change is in this commit.test_dbt.py: three hunks at base lines ~3954 (test_real_warn_result_is_ingested, classTestAddDbtTestResultSkipsCompiledOnly), ~4060-4063 (test_warning_test_with_null_message_is_ingested, classTestAddDbtTestResultNullMessage), and ~4540-4544 (test_freshness_warn_is_ingested_with_staleness_detail, classTestAddDbtSourceFreshnessResults). Base usesself.assertEqualat 3954 andTestCaseStatusis already imported at line 32.docs/decisions/2026-11-05-dbt-warnings-map-to-failed.md: new file, no conflict possible.test_dbt.pyormetadata.py), resolve by hand to the same end state:DbtTestFailureEnumgainsWARN;_map_dbt_test_statusreturns Failed/0 forwarnthrough the existing failure-enum branch with no new branch; the three tests assertTestCaseStatus.FailedandtestResultValue[0].value == "0". Keep the base'sassertEqualstyle only where the PR's text was not applicable. Do not touchDbtTestSuccessEnum,dbt_utils.py, oris_compiled_only_result.+/-content lines ofgit show 3872389cb9a -- <4 files>againstgit show HEAD -- <4 files>(the backport commit after step 6 or the cherry-pick result). Expected: no extra lines beyond the PR's. Any extra line means a conflict resolution leaked in.constants.pychange, revert only that file to the parent (git checkout HEAD~1 -- constants.py), run theVerification
Review (sol): approve
Files
Opened by taskr run 0177.