fix(looker): honor tag_measures_and_dimensions config in schema building#16317
Open
fix(looker): honor tag_measures_and_dimensions config in schema building#16317
Conversation
…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>
Contributor
|
Linear: ING-1715 |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Connector Tests ResultsAll connector tests passed for commit To skip connector tests, add the Autogenerated by the connector-tests CI pipeline. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
📋 Summary
Fix
tag_measures_and_dimensionsconfig being silently ignored in both Looker and LookML schema building.🎯 Motivation
The
tag_measures_and_dimensionsconfig (defaults toTrue) controls whether Dimension/Measure/Temporal tags are added to schema fields, or whether that info is prepended to the field description instead. Setting it toFalsehad 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:
tag_measures_and_dimensionsparameter toLookerUtil._get_schema()and forwarded it to_get_fields_and_primary_keys()lookml_source.py→_build_dataset_entities()builds schema for LookML viewslooker_common.py→LookerExplore._to_metadata_events()builds schema for exploresExample — field
country(type: dimension) withtag_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 containedglobalTagswith Dimension/Measure/Temporal tags — confirming the bug was baked into the test expectations. After the fix, the golden files correctly reflect thefalsebehavior: tags are absent and field type is prepended to descriptions. This accounts for the large diff (-1518 lines), which is entirely removal ofglobalTagsblocks.🧪 Testing
./gradlew :metadata-ingestion:lintFix)📊 Impact Assessment
tag_measures_and_dimensions: falseset 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)true) is unchanged