Skip to content

orionbelt converter: dimension round-trip fidelity (name restoration, N-per-column)#223

Open
ralfbecher wants to merge 1 commit into
apache:mainfrom
ralfbecher:fix/osi-converter-dimension-roundtrip
Open

orionbelt converter: dimension round-trip fidelity (name restoration, N-per-column)#223
ralfbecher wants to merge 1 commit into
apache:mainfrom
ralfbecher:fix/osi-converter-dimension-roundtrip

Conversation

@ralfbecher

Copy link
Copy Markdown
Contributor

Follow-up to #206. Mirrors two further canonical converter fixes from ralfbecher/orionbelt-semantic-layer into converters/orionbelt/. Both build on #206's _extract_dimensions work, which is why they land now that #206 has merged.

Restore the OBML dimension name (canonical #228)

The OSI field name is the physical column code, so a round trip renamed every dimension to its code and could trip #206's collision fallback for names that were unique in the source. The name is now preserved in an obml_dimension_name extension and restored on import, so the space-qualified collision fallback is genuinely foreign-OSI only - for an OBML-origin model it no longer fires (this is the concern @khush-bhatia raised on #206). Non-string values are ignored so a foreign payload cannot crash the converter on an unhashable dict key.

Preserve N dimensions over one column (canonical #229)

OBML allows many dimensions on one column (grain variants, role-playing); OSI is field-centric (one dimension per field). The converter used to drop every dimension past the first, silently. Extras are now preserved in an obml_extra_dimensions list extension with a fidelity warning (warn, not raise) and rebuilt on import. Both primary and extra dimensions carry their own synonyms and vendor extensions, with shape guards on the opaque extension data.

Also

Adds the ASF license header to test_osi_converter_roundtrip_robustness.py, which was missing it (the sibling converter files have it).

Tests

tests/test_osi_converter_roundtrip_robustness.py (dimension name restoration, N-per-column, synonym/extension preservation, malformed-payload guards) plus updated test_osi_converter_properties.py. 177 converter tests pass; ruff clean.

Canonical changes: ralforion/orionbelt-semantic-layer#228, #229 (both merged).

Mirrors two further canonical converter fixes on top of apache#206 (round-trip
robustness):

- ralforion/orionbelt-semantic-layer#228: restore the OBML dimension name
  across the round trip. The OSI field name is the physical column code, so a
  round trip renamed every dimension to its code and could trip the collision
  fallback for names unique in the source. The name is preserved in an
  obml_dimension_name extension and restored on import, making the collision
  fallback (the space-qualified key from apache#206) genuinely foreign-OSI only.
  Non-string values are ignored so a foreign payload cannot crash the converter
  on an unhashable key.

- ralforion/orionbelt-semantic-layer#229: preserve N dimensions over one
  column. OBML allows many dimensions on one column (grain variants, role
  playing); OSI is field-centric. Extras are preserved in an
  obml_extra_dimensions list extension with a fidelity warning (warn, not
  raise) and rebuilt on import. Both primary and extra dimensions carry their
  own synonyms and vendor extensions, with shape guards on the opaque
  extension data.

Also adds the ASF license header to test_osi_converter_roundtrip_robustness.py,
which was missing it. 177 converter tests pass; ruff clean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant