Skip to content

Preserve dbt semantic entity metadata in Analytics discovery - #7363

Merged
steve8708 merged 2 commits into
mainfrom
steve8708/analytics-dbt-semantic-index-truth
Oct 10, 2026
Merged

steve8708 merged 2 commits into
mainfrom
steve8708/analytics-dbt-semantic-index-truth

Conversation

@steve8708

Copy link
Copy Markdown
Contributor

Summary

  • Preserve dbt semantic models' declared top-level primary_entity in the generated Analytics source index and metric entries.
  • Keep row grain based on explicit grain, model unique keys, or a primary entity expression, rather than inferring grain from the semantic entity name.
  • Add regression coverage for the live dbt YAML shape and a user-facing changelog entry.

Validation

  • pnpm --filter analytics exec vitest run scripts/build-source-index.spec.ts (13 passed)
  • pnpm --filter analytics typecheck
  • pnpm guards (89 passed)
  • git diff --check

No dbt definitions, production rows, or credentials were changed.

@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Visual recap — readback failed

The recap was published, but the workflow could not verify it. Screenshot capture was skipped. Open the interactive recap directly:

Open the full interactive recap

Diagnostic:

Published recap readback failed: get-visual-plan returned HTTP 403; the configured token cannot read this published recap

builder-io-integration[bot]

This comment was marked as outdated.

@builder-io-integration builder-io-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Builder reviewed your changes and has a few items to flag 🟡

Review Details

Incremental Code Review Summary

The update addresses the prior review finding: when the top-level primary_entity is omitted, the index now falls back to the declared typed primary entity's name, while retaining the entity expression separately for grain and definition text. The added regression test covers this case. I resolved the previous review thread after verifying that behavior in the updated diff.

New finding

  • LOW — Potential metadata mismatch if declarations conflict: If a dbt model supplies both a top-level primary_entity and a typed type: primary entity with different names, the index uses the top-level value for primaryEntity but the typed entity's expression for grain/definition. This is an unusual input, and I did not find evidence it is a supported or valid dbt combination, so it is non-blocking.

The PR remains standard risk. The intended behavior of not inferring grain from an entity name is consistent with the stated change; the claim that top-level primary_entity alone should produce grain is not a confirmed issue here because no primary-entity expression is present. 🧪 Browser testing: Skipped — only source-index generation, tests, and changelog files changed; no browser-facing UI behavior is affected.

@steve8708
steve8708 merged commit b2b7877 into main Oct 10, 2026
37 checks passed
@steve8708
steve8708 deleted the steve8708/analytics-dbt-semantic-index-truth branch October 10, 2026 23:07
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