Add Snowflake → OSI import converter (snowflake_to_osi)#163
Open
sudulakuntanithin wants to merge 1 commit into
Open
Add Snowflake → OSI import converter (snowflake_to_osi)#163sudulakuntanithin wants to merge 1 commit into
sudulakuntanithin wants to merge 1 commit into
Conversation
khush-bhatia
self-requested a review
June 19, 2026 22:26
Comment on lines
+594
to
+606
| def _warn_dropped_fields(source, context): | ||
| """Warns about Snowflake fields that have no OSI counterpart. | ||
|
|
||
| These are fields that exist in the Snowflake model but should not be | ||
| dropped silently; they should be captured in custom_extensions or | ||
| explicitly warned about. | ||
| """ | ||
| # Snowflake-specific fields that don't map to OSI and weren't handled: | ||
| # - warehouse, database, schema (table-level config) | ||
| # - any other vendor-specific fields (these should be in custom_extensions now) | ||
|
|
||
| # For now, we don't warn about anything here since we capture all unknown | ||
| # fields in custom_extensions. The warning is implicit in the custom_extensions. |
Contributor
There was a problem hiding this comment.
This method looks empty ? Do you want to track this issue for follow up ?
Comment on lines
+481
to
+482
| # - filters: Snowflake-specific row-level security filters | ||
| # - tags: Snowflake tags for metadata (preserved in custom_extensions as vendor-specific) |
Contributor
There was a problem hiding this comment.
How are filters and tags mapped to OSI fields ?
jbonofre
self-requested a review
July 14, 2026 18:40
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.
Closes #162.
Adds the import direction for the Snowflake converter: snowflake_to_osi_yaml_converter.py, converting Snowflake Cortex Analyst semantic view YAML into OSI. The converters/snowflake/ directory previously shipped only osi_to_snowflake (export); this completes the bidirectional pair, consistent with the converter guide and roadmap.
Mapping (verified against the official semantic view YAML spec):
tables → datasets; base_table ({database, schema, table}) → source
dimensions / time_dimensions / facts → fields (with dimension.is_time set appropriately)
Both table-level and view-level metrics → OSI top-level metrics
relationships (left_table/right_table, relationship_columns) → from/to/from_columns/to_columns
Snowflake-specific settings preserved in custom_extensions (vendor_name: SNOWFLAKE); unmapped constructs raise warnings rather than failing silently
Testing:
117 tests pass (pytest tests/), including unit, integration, and a round-trip test through the existing exporter
Output validates against osi-schema.json, including sqlglot SQL validation
CLI mirrors the existing converter: python3 src/snowflake_to_osi_yaml_converter.py -i input.yaml -o output.yaml
Notes / open questions for maintainers:
On duplicate metric names (table-level vs. derived), the converter keeps the first and warns — happy to change to name-qualification if preferred.
README updated to document both directions.