Skip to content

Fixes 35383: Respect dbt source physical identifiers - #35680

Merged
ulixius9 merged 7 commits into
open-metadata:mainfrom
Vamsi-klu:codex/fix-35383-dbt-source-identifiers
Nov 12, 2026
Merged

ulixius9 merged 7 commits into
open-metadata:mainfrom
Vamsi-klu:codex/fix-35383-dbt-source-identifiers

Conversation

@Vamsi-klu

@Vamsi-klu Vamsi-klu commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #35383

When a dbt source declares name: orders and identifier: raw_orders, attach its metadata and downstream lineage to raw_orders. Both source enrichment and upstream resolution now use the existing identifier-aware helper. Logical source() references and model, seed and snapshot aliases retain their current behavior.

Suggested reviewers

@ulixius9.

Type of change:

  • Bug fix

High-level design:

Use get_source_physical_name for normalized source resource types at the two table-resolution sites in DbtSource. Keep the existing filtering, catalog mapping, cross-service resolution and resolved-entity UUID/FQN handling. Add a source manifest fixture and 42 parametrized regressions.

Tests:

Use cases covered

  • Manifest-only and catalog-backed sources whose physical identifiers differ from their logical names.
  • A logical-name decoy and a missing physical table, preventing enrichment or lineage from attaching to the wrong table.
  • Identifier fallbacks, physical-name filters, string/enum resource types, aliases and snapshot locations.
  • Catalog mapping, cross-service resolution, ambiguous logical namespaces, source tests, freshness, ephemeral dependencies and exposures.
  • Manifest v4/v7/v8/v12 parsing, FQN quoting, missing dependencies and repeated ingestion.

Unit tests

Updated ingestion/tests/unit/test_dbt.py and added ingestion/tests/unit/resources/datasets/manifest_source_identifier.json.

Run Result
Central regressions before the fix 2 expected failures, missing source metadata and upstream lineage
Full test_dbt.py 282 passed
test_dbt_ingest.py, test_dbt_test_definition.py, test_dbt_test_descriptions.py, test_dbt_config_errors.py, test_dbt_http_config.py 60 passed
Final source-identifier, freshness, catalog-mapping and parsed-upstream classes 66 passed, overlapping the full-file run

The first two passing runs supplied empty table/metric custom-property definitions at the legacy HTTP setup boundary. Manifest parsing, transformations, FQNs and lineage generation used the real implementation. The final 66-test run used ordinary pytest:

source env/bin/activate
cd ingestion
PYTHONPATH=src python -m pytest -q \
  tests/unit/test_dbt.py::TestDbtSourceIdentifiers \
  tests/unit/test_dbt.py::TestAddDbtSourceFreshnessResults \
  tests/unit/test_dbt.py::TestCatalogMapping \
  tests/unit/test_dbt.py::TestDbtLineageReusesParsedUpstream

Coverage: yield_data_models 94.59% lines; parse_upstream_nodes_with_names 100% lines. Whole metadata.py coverage is 72.90% lines and 64.86% branches, below the 90% whole-class target.

make -C ingestion py_format py_format_check passed, with 3,094 files unchanged/already formatted. Scoped basedpyright reported 0 errors and 0 warnings against a temporary copy of the project baseline. git diff --check passed. The full ingestion unit suite and full static-check suite were not run.

Fresh validation after the upstream merge at 44e98cb624538cb9c22921a32b63012f4d8a44a8: 66 focused tests passed in 3.01s and 60 adjacent tests passed in 0.19s, both with ordinary pytest and PYTHONPATH=src, without the earlier HTTP-boundary harness. Current-schema model generation and installation completed. Scoped Ruff lint and format checks and git diff --check passed. All three dbt implementation/test files remain byte-identical to the previously validated source; the upstream merge introduced no dbt source changes.

Backend integration tests

Not applicable, Python ingestion changes only.

NOT NEEDED for this Python-only PR.

Ingestion integration tests

Three scripted workflows passed against the source-built local OpenMetadata server, using real MetadataWorkflow, the metadata-rest sink and persisted REST/lineage assertions:

  1. Manifest-only physical source, aliased model and logical decoy. Source/column descriptions and domain attach to raw_orders; table and column lineage point to stg_orders; the decoy remains untouched. Zero workflow errors or warnings.
  2. Complete source/model catalog. The same persisted metadata and lineage assertions pass with zero workflow errors or warnings.
  3. Physical source absent, logical decoy present. No metadata or upstream edge attaches to the decoy. Zero errors and expected missing-table warnings.

Import-based discovery found three affected unit files, all run above, and no importing integration test or dbt ingestion integration directory. The API workflows are local smoke scenarios; no permanent integration runner or full ingestion integration-suite run is claimed. No warehouse is required.

Playwright (UI) tests

Not applicable, no UI changes.

NOT NEEDED for this Python-only PR.

Manual testing performed

The scripted API checks created a unique service, database/schema, physical raw_orders, aliased stg_orders and logical orders decoy. They ran the actual dbt workflow with and without a catalog, fetched table metadata and lineage, then repeated the missing-physical-table case. No human manual session is claimed.

UI screen recording:

Not applicable, ingestion-only bug fix.

Checklist:

  • Read the contribution guide and applicable repository instructions.
  • Title follows Fixes <issue-number>: <short explanation>.
  • Linked issue through Fixes #35383.
  • Added regressions for the exact missing metadata and lineage behavior.
  • Ran and recorded applicable formatting, unit and API smoke checks.
  • Comments, schema migration and UI recording requirements checked; no new complex algorithm, schema or UI change.
  • Decision check: reuses existing source-resolution behavior; no new public contract, default or limit requiring an ADR.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no actionable new issue was found.

Summary

The PR attaches dbt source metadata and lineage to physical identifiers while keeping logical dbt names intact.

  • dbt sources now attach to tables named by their physical identifiers.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[dbt source] --> B[Physical identifier]
  B --> C[Literal table lookup]
  C --> D[Resolved table FQN and ID]
  D --> E[Source metadata]
  D --> F[Downstream lineage]
  D --> G[Freshness tests]
Loading

Reviews (2) · Last reviewed commit: "Fixes 35383: Resolve dbt source identifi..." · Reviewed by Greptile

@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@Vamsi-klu

Copy link
Copy Markdown
Contributor Author

@ulixius9, could you review the dbt source identifier resolution and lineage fallback in this fix? It reuses get_source_physical_name for source metadata and upstream lookups. The description records the unit tests, three real API/sink checks and coverage limits.

@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@Vamsi-klu
Vamsi-klu marked this pull request as ready for review October 17, 2026 21:30
@Vamsi-klu
Vamsi-klu requested a review from a team as a code owner October 17, 2026 21:30
@Vamsi-klu
Vamsi-klu requested a review from mohittilala October 17, 2026 21:30
@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

Keep binding resolution for dbt table lookup, and escape source identifiers so wildcard characters stay literal.

Co-authored-by: deepinsight coder <[email protected]>
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@Vamsi-klu

Copy link
Copy Markdown
Contributor Author

Bumping this for review. @ulixius9 could you take a look at the dbt source identifier change in dbt/metadata.py? @mohittilala is already requested.

ulixius9 and others added 2 commits November 12, 2026 14:25
context.exposures is set inside yield_data_models, so calling add_dbt_exposure
directly after get_dbt_objects raised AttributeError.
@ulixius9 ulixius9 added the safe to test Add this label to run secure Github workflows on PRs label Nov 12, 2026
@gitar-bot

gitar-bot Bot commented Nov 12, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk

Resolving dbt sources by physical identifiers changes metadata and lineage attachment; an incorrect identifier could omit metadata and upstream relationships.

Fixes dbt source metadata and downstream lineage so sources declaring a logical name with a different identifier attach to the physical table (e.g. raw_orders) rather than the logical name. Logical source() references and model/seed/snapshot aliases keep their existing behavior. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@ulixius9
ulixius9 enabled auto-merge (squash) November 12, 2026 09:01
@ulixius9
ulixius9 removed the request for review from mohittilala November 12, 2026 09:44
@ulixius9
ulixius9 merged commit 94e56a9 into open-metadata:main Nov 12, 2026
62 checks passed
ulixius9 added a commit that referenced this pull request Nov 12, 2026
…37644)

Backport of #35680 to 2.0. dbt sources now resolve their warehouse table
through `identifier` instead of the logical `name`, for the source's own
metadata, upstream lineage, table filters and test attachment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] dbt source metadata and lineage lookups ignore physical identifier

3 participants