Repository navigation
Conversation
A dbt source whose identifier ends in * (events_*) is a BigQuery wildcard table. Upstream parsing looked it up as one literal table, found nothing and dropped it, so models reading GA4-style sources lost that lineage. For services whose resolver supports wildcard tables (BigQuery), the data model now keeps the wildcard FQN as an upstream, and create_dbt_lineage expands it into one edge per match. The expansion searches where every other dbt node is looked up (catalogMapping database, then the manifest database, across services when searchAcrossDatabases is set) and runs once per run. An unmatched wildcard is reported and gets no edge instead of a single-table lookup. An incomplete match (over the candidate limit, date-constrained, or spread over several services) is reported, and both lineage stages of that model add their edges without overriding. Tests and exposures still need one table, and other engines keep the identifier literal. Records the rule as v3 of ADR:2026-11-03-bigquery-daily-shards-use-stable-logical-tables.
❌ 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 riskExpanding BigQuery dbt wildcard sources into lineage edges changes catalog dependency records; incomplete matches may leave dependencies missing or preserve stale edges. Makes dbt BigQuery wildcard sources (such as GA4's 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 |
Describe your changes:
Fixes #38703
Cherry-pick of #38704 to
2.0. On2.0,shardedTablesalready catalogs BigQuery shard families (#37002), but a dbt source declared as a wildcard table (GA4'sevents_*) still produces no dbt lineage: its identifier is escaped and looked up as one literal table. #38704 has the full description, design and rejected alternatives. In short:create_dbt_lineageexpands it into one edge per table the wildcard reads (both the daily and the intraday families).catalogMapping, the manifest database, then other services whensearchAcrossDatabasesis set.What differs from
main.2.0predates the dbt resolved-table cache (#38291), so the cherry-pick conflicted inyield_data_models:wildcard_expansions.clear()is kept there.LRU_CACHE_SIZEand importsLRUCachedirectly, becauseRESOLVED_TABLES_CACHE_SIZEdoes not exist on2.0.2.0's older parent lookup.Type of change:
High-level design:
Same as #38704.
Tests:
Use cases covered
Same as #38704: every test there applies unchanged to
2.0.Unit tests
2.0worktree. Models were regenerated from2.0's schemas with the pinneddatamodel-code-generator==0.83.0, and imports were checked to resolve to the2.0tree:pytest tests/unit/entity_resolution/ tests/unit/test_dbt.py tests/unit/test_dbt_ingest.py tests/unit/test_dbt_test_definition.py tests/unit/test_dbt_test_descriptions.py tests/unit/test_dbt_config_errors.py tests/unit/test_dbt_http_config.py tests/unit/topology/database/test_bigquery.py tests/unit/topology/database/test_bigquery_sharding.py→ 629 passed, 0 failed.
Backend integration tests
Ingestion integration tests
Playwright (UI) tests
Manual testing performed
The bug was found on a 2.0.10 dbt Cloud + BigQuery ingestion run (see #38703). The fix has not yet been re-run against that environment.
UI screen recording:
Not applicable: ingestion-only bug fix.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.REVIEW.mdrecord. The only new lines here are the conflict resolution and the cache import above.🤖 Generated with Claude Code