You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ossie.apache.org by yz...@apache.org on 2026/10/01 04:04:31 UTC
(ossie) branch main updated: Fix Sigma and NVIDIA GSF converters for flat semantic model documents (#417)
This is an automated email from the ASF dual-hosted git repository.
MonkeyCanCode pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ossie.git
The following commit(s) were added to refs/heads/main by this push:
new 22339545 Fix Sigma and NVIDIA GSF converters for flat semantic model documents (#417)
22339545 is described below
commit 22339545324d6b399cff2df6b0c7b640f710915c
Author: JB Onofré <jb...@apache.org>
AuthorDate: Thu Oct 1 06:04:25 2026 +0200
Fix Sigma and NVIDIA GSF converters for flat semantic model documents (#417)
PR #383 moved the Ossie document schema to one semantic model directly
at the document root (dropping the `semantic_model:` wrapper), and #407
fixed the Microsoft converter for it, but the Sigma and NVIDIA GSF
converters were never updated, so their CI failed on main as soon as an
unrelated change touched their paths and re-triggered it.
The Sigma, dbt, and wisdom converters share the `ossie` Python package's
OssieDocument/OssieSemanticModel pydantic models, so fixing OssieDocument
to match the flat schema required updating all three converters (and
their tests/snapshots) together to keep them internally consistent.
NVIDIA GSF parses Ossie YAML directly against a dict shape and is fixed
independently.
Co-authored-by: Claude Sonnet 5 <no...@anthropic.com>
---
converters/dbt/tests/test_msi_to_ossie.py | 2 +-
converters/sigma/src/ossie_sigma/ossie_to_sigma.py | 3 +--
converters/sigma/tests/test_ossie_to_sigma.py | 8 ++++----
converters/sigma/tests/test_roundtrip.py | 11 +++++++----
converters/wisdom/tests/test_ossie_to_wisdom.py | 4 ++--
python/src/ossie/models.py | 2 +-
6 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/converters/dbt/tests/test_msi_to_ossie.py b/converters/dbt/tests/test_msi_to_ossie.py
index 7641473e..fe9742ad 100644
--- a/converters/dbt/tests/test_msi_to_ossie.py
+++ b/converters/dbt/tests/test_msi_to_ossie.py
@@ -75,7 +75,7 @@ def _field_expr(result: OssieDocument, field_idx: int = 0) -> str:
def _ossie_metrics(result: OssieDocument) -> list:
- """Return Ossie metrics for the first semantic model, asserting they exist."""
+ """Return the document's Ossie metrics, asserting they exist."""
metrics = result.metrics
assert metrics is not None
return metrics
diff --git a/converters/sigma/src/ossie_sigma/ossie_to_sigma.py b/converters/sigma/src/ossie_sigma/ossie_to_sigma.py
index 453cd648..913a31a2 100644
--- a/converters/sigma/src/ossie_sigma/ossie_to_sigma.py
+++ b/converters/sigma/src/ossie_sigma/ossie_to_sigma.py
@@ -30,7 +30,6 @@ from ossie import (
OssieField,
OssieMetric,
OssieRelationship,
- OssieSemanticModel,
OssieVendor,
)
@@ -40,7 +39,7 @@ from ossie_sigma.sigma_formula import sql_to_sigma_formula
from ossie_sigma.spec_keys import MODEL_LEVEL_SPEC_KEYS
# Objects a `SIGMA` custom_extensions vendor entry can be attached to.
-_SigmaExtensionHost = Union[OssieDataset, OssieField, OssieMetric, OssieRelationship, OssieSemanticModel]
+_SigmaExtensionHost = Union[OssieDataset, OssieField, OssieMetric, OssieRelationship, OssieDocument]
_ID_NAMESPACE = uuid5(NAMESPACE_URL, "ossie.apache.org/converters/sigma")
diff --git a/converters/sigma/tests/test_ossie_to_sigma.py b/converters/sigma/tests/test_ossie_to_sigma.py
index 3e1495f0..2dbd242a 100644
--- a/converters/sigma/tests/test_ossie_to_sigma.py
+++ b/converters/sigma/tests/test_ossie_to_sigma.py
@@ -17,6 +17,7 @@
from pathlib import Path
+import pytest
import yaml
from ossie import (
OssieDataset,
@@ -28,7 +29,6 @@ from ossie import (
OssieMetric,
)
-import pytest
from ossie import OssieRelationship
from pydantic import ValidationError
@@ -121,7 +121,7 @@ def test_relationship_ids_are_scoped_by_owning_dataset():
OssieRelationship(
name="Parent", **{"from": "shipments"}, to="carriers", from_columns=["x"], to_columns=["y"]
),
- ]
+ ],
)
spec = OssieToSigmaConverter().convert(document).output
@@ -281,7 +281,7 @@ def test_untranslatable_expression_omits_the_column_instead_of_faking_a_formula(
]
),
)
- ]
+ ],
)
result = OssieToSigmaConverter().convert(document)
@@ -335,7 +335,7 @@ def test_datatypes_only_ever_emit_the_two_documented_format_kinds():
)
],
)
- ]
+ ],
)
columns = OssieToSigmaConverter().convert(document).output["pages"][0]["elements"][0]["columns"]
diff --git a/converters/sigma/tests/test_roundtrip.py b/converters/sigma/tests/test_roundtrip.py
index 6c03251d..4e5a0905 100644
--- a/converters/sigma/tests/test_roundtrip.py
+++ b/converters/sigma/tests/test_roundtrip.py
@@ -61,11 +61,14 @@ def test_osi_sigma_osi_roundtrip_preserves_portable_fields(fixture_name):
document_2 = SigmaToOssieConverter().convert(spec_2).output
def portable(document):
- model = document
return {
- "datasets": [(d.name, d.source, [(f.name, f.datatype) for f in d.fields or []]) for d in model.datasets],
- "relationships": [(r.name, r.from_dataset, r.to, r.from_columns, r.to_columns) for r in model.relationships or []],
- "metrics": [(m.name,) for m in model.metrics or []],
+ "datasets": [
+ (d.name, d.source, [(f.name, f.datatype) for f in d.fields or []]) for d in document.datasets
+ ],
+ "relationships": [
+ (r.name, r.from_dataset, r.to, r.from_columns, r.to_columns) for r in document.relationships or []
+ ],
+ "metrics": [(m.name,) for m in document.metrics or []],
}
assert portable(document_1) == portable(document_2)
diff --git a/converters/wisdom/tests/test_ossie_to_wisdom.py b/converters/wisdom/tests/test_ossie_to_wisdom.py
index f89f5413..bfee1bad 100644
--- a/converters/wisdom/tests/test_ossie_to_wisdom.py
+++ b/converters/wisdom/tests/test_ossie_to_wisdom.py
@@ -190,7 +190,7 @@ def test_one_to_one_note_restores_relationship_type():
to_columns=["id"],
ai_context="one-to-one relationship",
)
- ]
+ ],
)
export = OssieToWisdomConverter().convert(document, exported_at="2026-07-10T00:00:00+00:00").output
edges = export["domain"]["zsheet_json"]["relationshipGraph"]["relationships"]
@@ -203,7 +203,7 @@ def test_unresolved_metric_attaches_to_first_dataset():
document = OssieDocument(
name="m",
datasets=[OssieDataset(name="a", source="db.s.a"), OssieDataset(name="b", source="db.s.b")],
- metrics=[OssieMetric(name="row_count", expression=_snowflake("COUNT(*)"))]
+ metrics=[OssieMetric(name="row_count", expression=_snowflake("COUNT(*)"))],
)
result = OssieToWisdomConverter().convert(document, exported_at="2026-07-10T00:00:00+00:00")
export = result.output
diff --git a/python/src/ossie/models.py b/python/src/ossie/models.py
index 8b7a93e9..a31b8b1a 100644
--- a/python/src/ossie/models.py
+++ b/python/src/ossie/models.py
@@ -195,7 +195,7 @@ class OssieMetric(BaseModel):
class OssieSemanticModel(BaseModel):
- """Top-level container representing a complete semantic model."""
+ """Semantic model: the datasets, relationships, and metrics for one business domain."""
model_config = ConfigDict(frozen=True)