Skip to content

Accept object checksum on unit tests in dbt 2.x manifests - #9

Open
ulixius9 wants to merge 2 commits into
mainfrom
fix/dbt2-unit-test-checksum
Open

ulixius9 wants to merge 2 commits into
mainfrom
fix/dbt2-unit-test-checksum

Conversation

@ulixius9

@ulixius9 ulixius9 commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Problem

dbt 2.x (Fusion) writes a unit test's checksum as an object, while the v12 model expects a string, so parse_manifest() fails on any dbt 2.x manifest that contains a unit test:

unit_tests.`unit_test.rich.stg_orders.ut_stg_orders`.checksum
  Input should be a valid string [type=string_type, input_value={'name': 'none', 'checksum': ''}, input_type=dict]

Follow-up to #7; refs open-metadata/OpenMetadata#37570. OpenMetadata dbt ingestion is not affected (it blanks unit_tests before parsing); direct callers of the parser are.

Change

  • UnitTests.checksum: Optional[str] → Optional[Union[str, Checksum]] in manifest_v12, manifest_cloud, manifest_cloud_v1, manifest_cloud_v2, reusing the existing Checksum model that nodes use. dbt Core's string form still parses as str.
  • Fixture: tests/resources/v12/jaffle_shop/manifest_2.0_unit_tests.json, generated by dbt==2.0.9 (models, seeds, snapshot, sources, tests, unit test, exposure, semantic model + metric), added to TestManifestParser.
  • No version bump: OpenMetadata ingestion is unaffected, so this ships with the next release.

Testing

  • New cases fail on main with the error above and pass with the fix; full suite pytest tests → 76 passed; pre-commit run --all-files clean.
  • Same fixture with the checksum rewritten to a plain string still parses to str.

🤖 Generated with Claude Code

dbt 2.x (Fusion) writes a unit test's checksum as {"name": ..., "checksum": ...}
where dbt Core writes a plain string, so parse_manifest rejected every dbt 2.x
manifest containing a unit test. Accept either form on UnitTests.checksum and
cover it with a dbt 2.0.9 manifest that has a unit test. Bump to 0.1.6.

Refs open-metadata/OpenMetadata#37570

This branch has not been deployed

No deployments
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.

1 participant