Skip to content

fix(looker): honor tag_measures_and_dimensions config in schema building#16317

Open
askumar27 wants to merge 4 commits intomasterfrom
fix/tag-measures-and-dimensions
Open

fix(looker): honor tag_measures_and_dimensions config in schema building#16317
askumar27 wants to merge 4 commits intomasterfrom
fix/tag-measures-and-dimensions

Conversation

@askumar27
Copy link
Copy Markdown
Contributor

@askumar27 askumar27 commented Feb 23, 2026

📋 Summary

Fix tag_measures_and_dimensions config being silently ignored in both Looker and LookML schema building.

🎯 Motivation

The tag_measures_and_dimensions config (defaults to True) controls whether Dimension/Measure/Temporal tags are added to schema fields, or whether that info is prepended to the field description instead. Setting it to False had no effect — tags were always added regardless. This is a day-one implementation gap where the intermediate _get_schema() method never accepted or forwarded the parameter to the leaf method that handles it.

🔧 Changes Overview

Bug Fix:

  • Added tag_measures_and_dimensions parameter to LookerUtil._get_schema() and forwarded it to _get_fields_and_primary_keys()
  • Passed the actual config value at both call sites:
    • LookML path: lookml_source.py_build_dataset_entities() builds schema for LookML views
    • Looker path: looker_common.pyLookerExplore._to_metadata_events() builds schema for explores

Example — field country (type: dimension) with tag_measures_and_dimensions: false:

Before (config ignored, tags always present):

{
  "fieldPath": "country",
  "description": "The country",
  "globalTags": { "tags": [{ "tag": "urn:li:tag:Dimension" }] }
}

After (config honored, type info in description instead):

{
  "fieldPath": "country",
  "description": "Dimension. The country"
}

Golden file updates:
10 test golden files were regenerated because their corresponding tests all use tag_measures_and_dimensions: False. Previously, these golden files incorrectly contained globalTags with Dimension/Measure/Temporal tags — confirming the bug was baked into the test expectations. After the fix, the golden files correctly reflect the false behavior: tags are absent and field type is prepended to descriptions. This accounts for the large diff (-1518 lines), which is entirely removal of globalTags blocks.

🧪 Testing

  • All 37 LookML integration tests pass
  • All 56 LookML unit tests pass
  • All 18 Looker integration tests pass
  • All 4 Looker unit tests pass
  • Lint passes clean (./gradlew :metadata-ingestion:lintFix)

📊 Impact Assessment

  • Affected Components: Looker and LookML ingestion sources — schema field tagging only
  • Breaking Changes: Users who had tag_measures_and_dimensions: false set but were unknowingly relying on tags being present will see tags removed and type info in descriptions instead (which is the documented behavior they opted into)
  • Risk Level: Low — the fix makes behavior match the documented config contract; default (true) is unchanged

…ema()

The tag_measures_and_dimensions config was silently ignored because
_get_schema() never accepted or forwarded it to _get_fields_and_primary_keys().
Tags were always added regardless of the config value.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

Linear: ING-1715

@github-actions github-actions bot added the ingestion PR or Issue related to the ingestion of metadata label Feb 23, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@datahub-cyborg datahub-cyborg bot added the needs-review Label for PRs that need review from a maintainer. label Feb 23, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@datahub-connector-tests
Copy link
Copy Markdown

Connector Tests Results

All connector tests passed for commit bdf53de

View full test logs →

To skip connector tests, add the skip-connector-tests label (org members only).

Autogenerated by the connector-tests CI pipeline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ingestion PR or Issue related to the ingestion of metadata needs-review Label for PRs that need review from a maintainer.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant