Repository navigation
OssieSource: read current-spec Ossie documents, and never load less than they declare (v0.63.0) - #164
Merged
Merged
Conversation
…m empty apache/ossie#383 made a document one model with `name` and `datasets` at the root and dropped the `semantic_model` list, which was all OssieSource read. A current-spec document, such as NVIDIA Auto-Ontology's export, loaded with no tables, metrics or relationships and no warning. Both shapes are now read, the legacy one with a warning, and a document holding no model is refused. Also reads `expression.sql` (#617), which loaded as an empty expression, the `OSSIE_SQL_2026` dialect spelling, and dataset-scoped metrics (#591), named `dataset.metric` with the dataset's table as source_model. The converter's real output is a fixture, so the test pins what a producer emits rather than our reading of the spec. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rops From two reviews of the flat-document fix, one against the Ossie spec: - A field's column is the one its expression reads, not its name: NVIDIA's `customer_name` over `name` registered a column the table lacks, and computed fields were listed as columns. Relationship endpoints follow. - A model with no datasets, a nameless dataset/field/metric, and a metric with no expression are refused instead of loading empty or partial. - custom_extensions on datasets, fields, metrics and relationships are carried in `ossie_entity_extensions`; NVIDIA puts each metric's SQL there. - Dialect names compare case-folded, the caller's included. - Dataset-scoped metrics no longer claim a source_model: their expression names fields, so "reads this table alone" was unsupported. - Unmatched vendor-block keys, repeated vendors and duplicate metric names are named in warnings. - Docs: physical columns, entity extensions, the ANSI-first rationale (the AGG claim was wrong), ossie-schema.json, additionalProperties scope. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The dialect fallback took the first declared expression whatever its language, so a Tableau export's `SUM([Profit])` reached lookup_metric as the metric's SQL. The fallback now skips the formula languages in Ossie's dialect registry (TABLEAU, DAX, MDX, MAQL, SIGMA, THOUGHTSPOT, HOLISTICS_AQL, SPARQL); an explicit dialect= still returns one, and an unregistered dialect is still a fallback. A metric written only in those is kept the way dbt and Cube keep one they cannot express (#123): empty sql_expression, and an `untranslated` reason quoting each formula. A field written only in one registers no column. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Field columns are read with sqlglot only (plain SQL, then BigQuery and T-SQL quoting); the regex shortcut registered `current_date`, `TRUE` and `NULL` as columns, and a tokenizer error crashed the whole load. - describe_table carries the field vocabulary metrics still use: a renamed column notes its Ossie field, and a table lists its computed fields. - A same-named legacy model no longer overwrites an earlier one's vendor blocks; an empty dialect entry no longer hides a real expression; the unmatched-overlay warning names the caller's vendor; duplicate check O(1). - CHANGELOG: drill_by now names a physical column, a loud break for one written with a renamed field's name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Why
The Ossie spec moved under
OssieSource(last changed 2026-09-05):nameanddatasetsat the root, and dropped thesemantic_modellist we read. A current-spec document loaded as an empty source, with no warning. Found by running NVIDIA Auto-Ontology's real Ossie export through it.expression.sql; a metric written with onlysqlloaded with an empty expression.The contract's allowlist and forbidden operations were enforced throughout; what the agent lost was the metrics and joins.
What changes
Document shape and silent drops
semantic_modellist still loads, with a warning.dataset.metrichint), a vendor listed twice, a duplicate metric name.Physical columns (bug since v0.42.0)
customer_nameovernamenow registersname; a computed field, a keyword likecurrent_date, or an unparseable expression registers none. Relationship endpoints are mapped the same way. No fixture renamed a field, so no test could see this.describe_tablecarries the bridge:namereads(Ossie field: customer_name), andorderslistsnet_total = subtotal - discountas computed. Translating metric SQL is deferred: it means generating SQL, which Denodo consumers cannot use.Expressions
expression.sqlread as Ossie SQL, overriding anOSSIE_SQL_2026entry;ANSI_SQLstill preferred.TABLEAU,DAX,MDX, …). A metric written only in those is kept like dbt/Cube's untranslatable ones (DbtSource and CubeSource hand agents metric expressions without their aggregation or filters #123): emptysql_expression,untranslatedquoting the formula.Other
dataset.metric. No metric gets asource_modelfrom Ossie, since its expression names fields, not columns.get_extras()["ossie_entity_extensions"](NVIDIA puts each metric's physical SQL there).Behaviour change
0.63.0, not a patch:
ValueErrornaming what is missing;drill_byin our vendor block written with a renamed field's name now fails with "unknown column" (it named a column the table does not have).Testing
tests/test_semantic/test_ossie_document_shape.py, each watched failing first. Fixturetests/fixtures/ossie_flat_nvidia_auto_ontology.ymlis the converter's real output (apache/ossie-converters@cb4b46b,nvidia/), not a hand-written example.dialects) and were made valid.prek run --all-filesclean.describe_tableshows physical columns,lookup_metricreturns the metric, its certified SQL runs on DuckDB, allowlist and forbidden operations still block.Deferred
primary_key: [ID]vsto_columns: [id]).🤖 Generated with Claude Code