Fixes #27792: Read dbt test descriptions from config.meta and patch on re-ingestion#27793
Fixes #27792: Read dbt test descriptions from config.meta and patch on re-ingestion#27793nr-mdakilahmed wants to merge 3 commits intoopen-metadata:mainfrom
Conversation
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
1 similar comment
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
…a and patch on re-ingestion - Add _get_dbt_test_description() helper that resolves description from node.description (schema.yml) with fallback to node.config.meta["description"] (config() block in SQL file) - Patch TestDefinition and TestCase descriptions on re-ingestion when dbtUpdateDescriptions is enabled - Add 19 unit tests covering both fixes
9357e9f to
1933af5
Compare
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
Code Review ✅ Approved 1 resolved / 1 findingsIntegrates dbt test descriptions from config.meta during re-ingestion, resolving the duplicate _get_dbt_test_description call. No issues found. ✅ 1 resolved✅ Performance: Duplicate _get_dbt_test_description call in else branches
OptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
Fixes #27792
Changes
metadata.py:_get_dbt_test_description()helper — resolves description fromnode.description(schema.yml) with fallback tonode.config.meta["description"](config block in SQL). Follows existinghasattr+truthiness guard pattern used throughoutdbt_utils.py.create_dbt_tests_definition()andcreate_dbt_test_case()now use the helper for both creation and update paths.elseblocks to patch descriptions on re-ingestion when entity exists, description is available, anddbtUpdateDescriptionsis enabled.test_dbt.py:TestGetDbtTestDescription(7 tests) — covers priority, fallback, None, no-config, non-dict meta edge cases.TestDbtDescriptionUpdateOnRerun(12 tests) — covers both methods x (patch, skip-disabled, skip-empty, create, config.meta-create, config.meta-rerun).Why
config.meta.descriptionnever read: dbt tests can carry descriptions viaconfig(meta={'description': '...'})which lands atnode.config.meta.descriptionin manifest.json. OM only readsnode.description(the schema.yml path).Descriptions never updated on re-ingestion:
dbtUpdateDescriptions: truepatches table/column descriptions butTestDefinitionandTestCasedescriptions were silently skipped when the entity already exists.patch_description()already supports both entity types — confirmed inpatch_mixin.py(specialTestCasehandling withtestDefinition,testSuitefields) andtest_ometa_patch.py::test_patch_description_TestCase.Type
Checklist
Fixes <issue-number>: <short explanation>.