You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I added Tableau support for includeMetrics: every visible CalculatedField with the MEASURE role becomes a Metric entity, with its formula, type (falling back to the formula's aggregate when Tableau Cloud reports a null aggregation), unit, dimensions, relatedMetrics, and its data model as assets. Metric lineage now reflects where a measure is actually defined — a Tableau measure is a field of its datasource and a LookML measure a field of its view — so both Tableau and Looker draw Table → DataModel → Metric (column: the measure's model column → metric FQN) plus Metric → Metric, instead of a direct Table → Metric edge that skipped the model.
Type of change:
New feature
High-level design:
Tableau (tableau/metrics.py, new): pure mapping from DatasourceField → CreateMetricRequest; metrics are emitted parents-first (the server resolves relatedMetrics on create). Metric names are a stable hash of service + datasource id + field id, since Metric has no service namespace. The GraphQL query now fetches role/aggregation/defaultFormat/isHidden/upstreamFields for calculated fields.
Emission point: yield_dashboard_lineage runs after the data-model Barrier, so the data model the metric references (as asset and lineage source) is already persisted.
Lineage source = the data model: every datasource field / LookML field (measures included) is already a column of its data model, and the existing Table → DataModel column lineage feeds it. Drawing DataModel → Metric keeps a single true path, gives lineage to metrics whose warehouse table can't be resolved (extracts, files, derived-table views), and removed the source-table caching the direct edge needed (_datasource_source_tables, _view_source_refs, table_column_references, an LRU cache).
Lineage is sent as OMetaFQNLineageRequest, not through yield_lineage_request: with overrideLineage the sink would delete a metric's other incoming edges.
Known limit: Looker without git credentials ingests no view data models, so its metrics get only Metric → Metric lineage (unchanged from before).
Tests:
Use cases covered
Tableau calculated measures become Metrics with type/unit/dimensions/assets; hidden fields and plain columns are skipped; filtered-out data models emit nothing; includeMetrics off emits nothing
Derived measures reference their parent metric and are written after it
Tableau and Looker metric lineage comes from the declaring data model with the measure's column; no metric links straight to a table even with a DB service configured
Looker measures reported by the API but absent from LookML still link to their view (entity-level)
Calculated fields with the MEASURE role become Metric entities behind the
includeMetrics flag, with table->metric column lineage and metric->metric
lineage for measures built from other measures.
…data model
A Tableau calculated measure is a field of its datasource and a LookML measure
a field of its view; both are already columns of that data model, fed by the
model's own Table -> DataModel lineage. Draw DataModel -> Metric (column: the
measure's model column -> metric FQN) instead of skipping the model with a
direct Table -> Metric edge, and drop the source-table plumbing that edge
needed. Tableau also falls back to the formula's aggregate when Tableau Cloud
reports a null aggregation.
This PR cannot be merged until the following are addressed on its linked issue:
Linked issue open-metadata/openmetadata-collate#5989 does not exist or is not accessible.
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 skip-pr-checks label.
…ModelFilterPattern
_get_datamodel looks the model up on the server, so a model excluded now but
ingested by an earlier run still emitted its calculated measures as Metrics.
…neage
Metric edges bypassed yield_lineage_request, so a measure whose dependencies
changed kept its stale DashboardLineage edges. The sink's delete-by-source is
cached per target, so routing every edge through it clears stale lineage once
and keeps all current edges.
This regex removes // inside Tableau string literals, not just comments. For example, the valid outer aggregate SUM(IF CONTAINS([url], "http://example.com") THEN [sales] END) is truncated to SUM(IF CONTAINS([url], "http: and formula_aggregation returns None; on Tableau Cloud, where aggregation is null, the metric is therefore incorrectly classified as OTHER. Please strip comments with a quote-aware scanner/parser and add URL/quoted-parenthesis regression cases.
…lineage in yield_lineage_request
_views_cache is keyed by view name only, so two projects declaring the same
view handed each other's metrics the wrong data model for assets and lineage.
Metrics now resolve their view through a (project, view) keyed cache.
yield_lineage_request already forwards OMetaFQNLineageRequest (the sink and
OMetaLineageRequest accept it); widen its annotation so basedpyright passes.
🟡 Medium risk · Adds Tableau metric entities and changes Tableau/Looker lineage ingestion behavior.
Adds Tableau support for ingesting calculated measures as Metric entities with formula, type, unit, dimensions, and related metrics. Metric lineage now correctly flows through data models (Table → DataModel → Metric) instead of direct table-to-metric edges, and metrics excluded by dataModelFilterPattern are now properly skipped. All 312 unit tests pass with comprehensive coverage.
✅ 1 closed✅ Edge Case: Metrics still emitted for data models excluded by dataModelFilterPattern
📄 ingestion/src/metadata/ingestion/source/dashboard/tableau/metadata.py:838-841📄 ingestion/src/metadata/ingestion/source/dashboard/tableau/metadata.py:1159-1173📄 ingestion/src/metadata/ingestion/source/dashboard/tableau/metadata.py:289-292 yield_datamodel_metrics treats a missing _get_datamodel result as "filtered out". But _get_datamodel fetches the model from the OpenMetadata server by FQN and never checks dataModelFilterPattern. So when a datasource matches the filter in this run and its data model already exists on the server (from an earlier run before the filter was added, or when stale models aren't deleted), its calculated measures are still ingested as Metrics, with lineage and assets pointing at a model the user excluded. To fix this, run the same filter_by_datamodel(self.source_config.dataModelFilterPattern, datasource.name or datasource.id) check before _get_datamodel and skip the datasource when it matches.
Related metrics are ordered and resolved only within one datasource, but embedded datasources are processed before their upstreamDatasources. If an embedded calculated measure references a calculated field defined by its published datasource, the parent is absent from this per-datasource emitted set (and related_metric_names only scans the embedded fields), so both relatedMetrics and Metric→Metric lineage are silently dropped. Build a global field-to-defining-datasource index and topologically order the flattened datasource metrics before emitting them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes:
Fixes open-metadata/openmetadata-collate#5989
I added Tableau support for
includeMetrics: every visibleCalculatedFieldwith theMEASURErole becomes aMetricentity, with its formula, type (falling back to the formula's aggregate when Tableau Cloud reports a nullaggregation), unit, dimensions,relatedMetrics, and its data model asassets. Metric lineage now reflects where a measure is actually defined — a Tableau measure is a field of its datasource and a LookML measure a field of its view — so both Tableau and Looker draw Table → DataModel → Metric (column: the measure's model column → metric FQN) plus Metric → Metric, instead of a direct Table → Metric edge that skipped the model.Type of change:
High-level design:
tableau/metrics.py, new): pure mapping fromDatasourceField→CreateMetricRequest; metrics are emitted parents-first (the server resolvesrelatedMetricson create). Metric names are a stable hash of service + datasource id + field id, since Metric has no service namespace. The GraphQL query now fetchesrole/aggregation/defaultFormat/isHidden/upstreamFieldsfor calculated fields.yield_dashboard_lineageruns after the data-model Barrier, so the data model the metric references (as asset and lineage source) is already persisted._datasource_source_tables,_view_source_refs,table_column_references, an LRU cache).OMetaFQNLineageRequest, not throughyield_lineage_request: withoverrideLineagethe sink would delete a metric's other incoming edges.Tests:
Use cases covered
includeMetricsoff emits nothingUnit tests
test_tableau_metrics.py(new),test_looker_metric_stage.py,test_looker_measures.py,test_looker_issue_regressions.pytableau/metrics.py100%,looker/measures.py96% (tableau/metadata.py63%,looker/metadata.py77% whole-file)Backend integration tests
Ingestion integration tests
Playwright (UI) tests
Manual testing performed
Not yet run against a live Tableau site; unit-tested only.
UI screen recording / screenshots:
Not applicable.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.