Databricks Unity Catalog Metric View converter#152
Open
jackstein21 wants to merge 2 commits into
Open
Conversation
Add entries for Python build artifacts, Hypothesis test database, IDE files, OS junk, and test coverage output.
Add bidirectional converter between OSI semantic model YAML and Databricks Unity Catalog Metric View YAML (v1.1). Import (Metric View → OSI): - Maps fields to OSI fields with DATABRICKS dialect expressions - Maps measures to OSI metrics - Parses JOIN ON/USING clauses into OSI relationships - Preserves synonyms, display_name, and comments as ai_context - Stores Databricks-specific metadata (filter, materialization, window, format) in custom_extensions Export (OSI → Metric View): - Generates valid Metric View YAML per dataset - Selects DATABRICKS dialect with ANSI_SQL fallback - Reconstructs JOIN clauses from OSI relationships - Restores filter and materialization from custom_extensions Also includes: - CLI entry point (osi-databricks import/export) - Comprehensive test suite (unit + Hypothesis property tests) - TPC-DS-based test fixtures - README with mapping table and usage examples
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
Adds a bidirectional Python converter between OSI YAML and Databricks Unity Catalog Metric View YAML (v1.1). This fills the Databricks spoke in the hub-and-spoke converter architecture —
DATABRICKSis listed as a supported vendor in the spec andconverters/index.mdbut had no converter implementation until now.What's included
osi-databricks import/osi-databricks exportentry pointsMapping highlights
fields[].exprfield.expression.dialects[DATABRICKS]measures[].exprmetric.expression.dialects[DATABRICKS]joins[].onrelationship.from_columns/to_columnssynonyms,display_nameai_context.synonymscommentdescriptionfilter,materialization,window,formatcustom_extensions(vendor: DATABRICKS)Dialect selection follows the converter guide: prefer DATABRICKS, fall back to ANSI_SQL.
Conventions followed
converters/databricks/withsrc/osi_databricks/layoutosi-python>=0.2.0.dev0andPyYAML>=6.0Testing
cd converters/databricks uv sync uv run pytestAll tests pass locally on Python 3.14.
Notes
This is a tooling/converter contribution, not a spec change
The
.gitignorecommit adds standard entries (build artifacts, Hypothesis DB, IDE files) that benefit all contributorsMetric View materialization support is included but marked as preview (Databricks docs note it's in preview)