Skip to content

Add Snowflake → OSI import converter (snowflake_to_osi) #162

Description

@sudulakuntanithin

The converters/snowflake/ directory currently ships only the export direction (osi_to_snowflake_yaml_converter.py). The import direction (Snowflake Cortex Analyst semantic view YAML → OSI) doesn't exist yet, though the roadmap lists bidirectional participant↔OSI converters as a goal.
I'd like to contribute it. I've built a snowflake_to_osi_yaml_converter.py that:

Maps Snowflake tables → OSI datasets, base_table → source, dimensions/time_dimensions/facts → fields, and both table-level and view-level metrics → OSI top-level metrics, validated against the official semantic view YAML spec.
Maps relationships (left_table/right_table, relationship_columns) → OSI from/to/from_columns/to_columns.
Preserves Snowflake-specific settings in custom_extensions to avoid silent data loss, with warnings for unmapped constructs.
Includes a test suite (unit, integration, and a round-trip test through the existing exporter) and output that validates against osi-schema.json including sqlglot SQL validation.

Is anyone already working on this? If not, I'll open a PR. Happy to adjust the mapping approach based on maintainer preferences.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions