Skip to content

fix: [AI-7435] accept dbt 2.0 reused run status in run_results v6 parser - #106

Merged
Sourabhchrs93 merged 3 commits into
mainfrom
fix/ai-7435-run-results-reused-status
Jul 9, 2026
Merged

fix: [AI-7435] accept dbt 2.0 reused run status in run_results v6 parser#106
Sourabhchrs93 merged 3 commits into
mainfrom
fix/ai-7435-run-results-reused-status

Conversation

@Sourabhchrs93

@Sourabhchrs93Sourabhchrs93 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes AI-7435. dbt 2.0 emits status="reused" for unchanged models. The run_results v6 Status enum only knew success/error/skipped/partial_success, so Result validation raised ValidationError and the ingestion worker silently dropped the entire run_results.json — run status/timing never persisted, while the UI still showed a clean successful sync.

Confirmed against the currently-released 0.2.3: parsing a result with status="reused" raises ValidationError (3 errors for Result). DocuSign hit this on every run while on dbt 2.0.

Changes

  • Add reused to run_results_v6.Status; make it a str, Enum.
  • Add Status._missing_ so future unknown dbt statuses surface as real members instead of failing validation (forward-compatibility).
  • Reorder Result.status union to Union[Status1, Status2, Status] so the now-permissive run Status is tried last, keeping test/freshness statuses (pass/fail/warn/runtime error) resolving via the strict Status1/Status2 enums.
  • Regression tests: reused, known statuses, unknown-future status, test/freshness statuses, and full-file parse_run_results.
  • Version bump 0.3.1 → 0.3.2 (0.3.1 already released without this fix).

Testing

tests/test_vendor/test_run_results_v6.py ..... 5 passed

Follow-up (not in this PR)

  • Release/publish altimate-datapilot-cli 0.3.2.
  • altimate-backend: poetry update altimate-datapilot-cli to move the lock 0.3.1 → 0.3.2 (pin ^0.3.1 already admits it), then deploy.
  • Backfill DocuSign invocations dropped while on 0.2.x.

🤖 Generated with Claude Code

…arser
dbt 2.0 emits `status="reused"` for unchanged models. The `run_results` v6
`Status` enum only knew `success`/`error`/`skipped`/`partial_success`, so
`Result` validation raised `ValidationError` and the ingestion worker silently
dropped the entire `run_results.json` — run status/timing never persisted while
the UI still showed a clean successful sync.
- Add `reused` to `Status` and make it a `str, Enum`.
- Add `Status._missing_` so future unknown dbt statuses surface as real members
instead of failing validation (forward-compatibility).
- Reorder `Result.status` union to `Union[Status1, Status2, Status]` so the now
permissive run `Status` is tried last, keeping test/freshness statuses
(`pass`/`fail`/`warn`/`runtime error`) resolving via the strict enums.
- Add regression tests covering `reused`, known statuses, unknown-future status,
test/freshness statuses, and full-file `parse_run_results`.
- Bump version to `0.3.2` (`0.3.1` already released without this fix).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment threadsetup.py
setup(
name="altimate-datapilot-cli",
version="0.3.1",
version="0.3.2",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Version bump is incomplete — docs/conf.py and .bumpversion.cfg still report 0.3.1.

.bumpversion.cfg coordinates the version across three files (setup.py, docs/conf.py, src/datapilot/__init__.py). This PR updated setup.py and __init__.py to 0.3.2 but left docs/conf.py at version = release = "0.3.1" and .bumpversion.cfg at current_version = 0.3.1.

Consequences:

  • Sphinx docs will publish showing 0.3.1 while the package ships 0.3.2.
  • The next bumpversion run will fail: its search = version="{current_version}" pattern (0.3.1) no longer matches setup.py (now 0.3.2), raising VersionNotFoundError.

Use bumpversion patch (which updates all three files plus current_version and commits/tags), or bump all three files together so the version stays coordinated.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — fixed in da9e0ea. Bumped .bumpversion.cfg (current_version) and docs/conf.py to 0.3.2; all four bumpversion-tracked files now agree.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@suryaiyer95 addressed — all four bumpversion-tracked files (setup.py, docs/conf.py, src/datapilot/__init__.py, .bumpversion.cfgcurrent_version) now agree at 0.3.2 (commit da9e0ea). Also fixed a ruff I001 lint that CI flagged (cd9d9f1). check and the full test matrix are green now.

@kilo-code-bot

kilo-code-botBot commented Jul 8, 2026

Copy link
Copy Markdown

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

SeverityCount
CRITICAL0
WARNING1
SUGGESTION0
Issue Details (click to expand)

WARNING

FileLineIssue
setup.py16Version bumped to 0.3.2 in setup.py and __init__.py only; docs/conf.py and .bumpversion.cfg still report 0.3.1, breaking the coordinated bumpversion release workflow.
Files Reviewed (4 files)
  • setup.py - 1 issue (incomplete version bump)
  • src/datapilot/__init__.py - no issues
  • src/vendor/dbt_artifacts_parser/parsers/run_results/run_results_v6.py - no issues
  • tests/test_vendor/test_run_results_v6.py - no issues

The core fix is correct and well-covered: adding reused to Status and the _missing_ forward-compatibility hook, plus reordering Result.status to Union[Status1, Status2, Status], properly resolves the dbt 2.0 status="reused"ValidationError that was silently dropping run_results.json. All five regression tests pass and downstream .value access is preserved for known, unknown, and test/freshness statuses.

Fix these issues in Kilo Cloud


Reviewed by glm-5.2 · Input: 48.9K · Output: 18.8K · Cached: 479.6K

@suryaiyer95suryaiyer95 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, Kilo code seems to have a valid comment. Can you take a look>

Comment threadsetup.py
setup(
name="altimate-datapilot-cli",
version="0.3.1",
version="0.3.2",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^

Sourabhchrs93and others added 2 commits July 9, 2026 12:45
…ion files
Kilo Code review flagged that `.bumpversion.cfg` and `docs/conf.py` still
reported `0.3.1`. Bump both to `0.3.2` so all files `bumpversion` tracks
(`setup.py`, `docs/conf.py`, `src/datapilot/__init__.py`, `current_version`)
stay coordinated — prevents Sphinx publishing a stale version and a future
`bumpversion` `VersionNotFoundError`.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Project isort config uses force-single-line; split the combined
`Result, Status` import onto separate lines.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Sourabhchrs93
Sourabhchrs93 merged commit b0ad844 into mainJul 9, 2026
32 of 33 checks passed
Sourabhchrs93 added a commit that referenced this pull request Jul 22, 2026
…-v5 parsers (#108)
Mirror of the v6 `Status` shim (AI-7435, PR #106) for the pre-v6 schemas,
closing the residual of AI-7675 finding #2: any run status outside
`success`/`error`/`skipped` (e.g. dbt 2.0 `reused`, or any future status)
raised a `ValidationError` in run_results v1-v5 and the ingestion worker
silently dropped the entire `run_results.json`.
- Make `Status` a `str, Enum`, add `reused`, and add the `_missing_`
forward-compat fallback so unknown statuses surface as real members
instead of failing validation (identical to the v6 fix).
- Reorder `RunResultOutput.status` to `Union[Status1, Status2, Status]`
so test/freshness statuses (`pass`/`fail`/`warn`/`runtime error`) keep
resolving via the strict enums and the permissive run `Status` is tried
last (same reordering as v6).
- Add parameterized regression tests over v1-v5 mirroring
`test_run_results_v6.py`, including full-file `parse_run_results`.
Freshness-specific enums (`Status3`/`Status4` in v3/v4) are untouched,
matching the v6 fix scope.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
shreyastelkar added a commit that referenced this pull request Aug 25, 2026
…sources v1-v3 (#114)
The dbt Fusion engine serializes source-freshness `status` with its Rust
variant names -- `"Pass"` / `"Warn"` / `"Error"` -- while dbt-core and the
published `sources/v3.json` schema Fusion itself stamps into the artifact
both use the lowercase forms. Every result row therefore failed both members
of the `results` union, the whole `sources.json` raised a `ValidationError`,
and the ingestion worker silently dropped it. Nine of harvestgroup's ten
production environments have zero source-freshness rows as a result.
This is the residual of the AI-7675 work: PR #106/#108 added the `_missing_`
forward-compat shim to the `run_results` status enums but explicitly left the
freshness enums, and the `sources` parsers entirely, untouched.
- Make `Status1` a `str, Enum` whose `_missing_` case-folds to the canonical
lowercase member first, then falls back to the same forward-compat
pseudo-member used by the `run_results` shim for unknown statuses.
- Case-folding rather than adding PascalCase members is deliberate: the
extractor persists `status.value`, and every dbt-core-backed tenant already
writes lowercase into the same table.
- Leave the runtime-error-only `Status` enum strict. Fusion has no
runtime-error variant, and loosening it would let a row missing a required
field fall silently into the field-less branch instead of erroring.
- Apply to v1-v3 rather than v3 alone, mirroring how #108 had to follow #106
across the older schemas.
Verified against 432 real production artifacts spanning all nine Fusion
environments and 13 Fusion builds (preview.190 -> .210), run through parse
AND the worker's own `extract_sources`: 432/432 parsed, 10,893 freshness rows
extracted, every capitalized input landing as its lowercase counterpart.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for freeto 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.

2 participants

@Sourabhchrs93@suryaiyer95