Repository navigation
feat(core-spec): rename expression.dialects to nonportable_dialects (breaking) - #817
MrBlack1995 wants to merge 2 commits into
Conversation
d18ceeb to
2f9bee6
Compare
jbonofre
left a comment
There was a problem hiding this comment.
Can you please rebase from main? Several conflicts will need to be addressed.
| | 2026-11-13 | Core / Expression language [#703](https://github.com/apache/ossie/pull/703) | **`AGG(dataset.metric)` in model-scoped metrics.** A model-scoped metric can evaluate a dataset-scoped metric, so a model reuses the metric instead of repeating its definition. | Additive. The argument is a single `dataset.metric` reference, and the call takes no `FILTER (WHERE ...)` clause. A model-scoped metric cannot refer to a metric in any other way. Consumers that read model-scoped metrics must resolve `AGG(dataset.metric)`. Existing documents need no change. | | ||
| | 2026-11-13 | Core / Ontology [#705](https://github.com/apache/ossie/pull/705) | **A key, and an ontology list of names or expressions, names each thing once.** A key is the set of fields it names, and a supertype, identifying relationship, constraint or verbalization pattern given twice says nothing the first already said. | **Validation becomes stricter.** `primary_key` and each `unique_keys` definition reject a repeated field, as do the ontology's `extends`, `identify_by` and `verbalizes` lists and `requires` and `derived_by` wherever they appear. Field names resolve case-insensitively, so `[email, EMAIL]` repeats one field; that case is reported by the validator rather than the schema. Remove the duplicate entry; a document that had one declared less than it appeared to. A `unique_keys` definition that restates another remains valid and is reported as a warning. | | ||
| | 2026-11-20 | Core / Expression language [#726](https://github.com/apache/ossie/pull/726) | **`AGG(source.measure)` in dataset-scoped metrics.** When a dataset's `source` is a measure relation, a dataset-scoped metric can compose a source measure into its expression, so a model reuses the measure instead of repeating its definition. The measure keeps the rows that it aggregates and their row identity, and is evaluated when a consuming query evaluates the metric. A `source` is a measure relation only if every query reads one multiset of rows, can group and filter every measure by every other column, and can join the `source` with no duplication in a measure. | Additive. Document validation checks only the form of each `AGG` call. A consumer that generates SQL against a dataset's `source` must reject a metric or field that refers to a source measure outside `AGG`, and a metric that calls `AGG` on a column that is not a measure of the `source`. It must not replace `AGG` with an ordinary aggregate, and may reject a `source` that it does not support. Existing documents need no change. | | ||
| | 2026-12-03 | Core [#817](https://github.com/apache/ossie/pull/817) | **`expression.dialects` is renamed to `nonportable_dialects`.** `OSSIE_SQL_2026`, written in the top-level `sql`, is the only expression language this specification defines; every other dialect is opaque and implementations MAY ignore it. The key now says so, as `nonportable_extensions` does since [#522](https://github.com/apache/ossie/pull/522) (dev@ thread TBD). | **Breaking within unreleased `0.3.0.dev0`.** Rename the key `dialects` to `nonportable_dialects` in every expression; the old name is not accepted and there is no alias. Nothing else changes: the entries, the rule that at least one of `sql` or the list is present, and the rule that `sql` is authoritative over an `OSSIE_SQL_2026` entry are the same. The Python model field `OssieExpression.dialects` is renamed with it. Converters rename the key they read and write. | |
There was a problem hiding this comment.
Now that the [DISCUSS] thread is live, we can replace (dev@ thread TBD) using the same format as row above:
([dev@ lazy consensus](https://lists.apache.org/thread/h0fot53f9df1v3x4rk1sgs3njwn302s0))
Also note the lazy consensus end date in the email is 2026-12-01 (currently 2026-12-03 here), let's update this date to the actual merge date when landing.
There was a problem hiding this comment.
Done in 8e92f42: the row links the thread, and the date is 2026-12-02 for now. I will set it to the actual date when it lands.
| def _require_sql_or_dialects(self) -> "OssieExpression": | ||
| if self.sql is None and not self.dialects: | ||
| raise ValueError("expression requires at least one of 'sql' or 'dialects'") | ||
| if self.sql is None and not self.nonportable_dialects: | ||
| raise ValueError("expression requires at least one of 'sql' or 'nonportable_dialects'") |
There was a problem hiding this comment.
Heads-up: #651 changed line 282 on main to def _require_sql_or_dialects(self) -> OssieExpression:, so this hunk will conflict on rebase.
When resolving it, consider renaming the private validator method as well so it matches the field and error messages:
@model_validator(mode="after")
def _require_sql_or_nonportable_dialects(self) -> OssieExpression:
if self.sql is None and not self.nonportable_dialects:
raise ValueError("expression requires at least one of 'sql' or 'nonportable_dialects'")
return self…breaking) OSSIE_SQL_2026, written in the top-level `sql`, is the only expression language the specification defines. Every other dialect is opaque to it and implementations MAY ignore it, but in the file the list of those entries was called `dialects`, a peer of `sql`. apache#522 renamed `custom_extensions` to `nonportable_extensions` so that the name says which side of that line a field is on; this does the same for the dialect entries. Pure rename, no alias, as in apache#522: the schema, the specification and its examples, the validator, the Python model field, the OST expander, the portability fixtures and the grader read and write `nonportable_dialects`. The entries, the rule that at least one of `sql` or the list is present, and the rule that `sql` is authoritative over an OSSIE_SQL_2026 entry are unchanged. A document that still uses `dialects` fails schema validation. Breaking within the unreleased 0.3.0.dev0; recorded in the spec.md changelog and in docs/spec_changes.md. Co-authored-by: Isaac <no-reply@databricks.com>
2f9bee6 to
6245db8
Compare
… model validator The docs/spec_changes.md row for the rename links the lazy consensus thread and carries the first possible landing date. The private validator of OssieExpression is named after the field it checks. Co-authored-by: Isaac <no-reply@databricks.com>
|
+1 on the rename and on the reasoning behind it. A name that says which side of Taking you up on the converter offer. There is one property of this rename worth The writer has no window. The third line is the one that matters. The new key is rejected even beside a That is how #522 actually landed, and it seems worth copying rather than Readers are the opposite, and that is where the cheap win is. A reader can On scale, 26 of the 28 converters reference Happy to take |
|
Thanks for checking this against the pin, and for taking thoughtspot. I agree with the sequencing. I reproduced the three results against d27a6be: Accepting both names in the readers ahead of the bump works for me, with the rule you describe: read either name, write the new one from the bump on, and refuse a document that carries both. Two notes on that:
What I will do: once this PR has merged, I prepare the pin bump with the writers, fixtures and tests for every converter that has not been taken by then, and I open the reader half for the converter I work on ahead of it. Your count matches mine: 26 of the 28 converters reference the key under |
Summary
Rename the
dialectskey of an expression tononportable_dialects.OSSIE_SQL_2026, written in the top-levelsql, is the only expression language the specification defines. Every other dialect is opaque to it, and implementations MAY ignore it. In the file, however, the list of those entries is calleddialectsand sits next tosqlas a peer. #522 renamedcustom_extensionstononportable_extensionsso that the name says which side of that line a field is on. This PR does the same for the dialect entries.It is a pure rename with no alias, the approach of #522:
core-spec/ossie-schema.json(Expression.propertiesand itsanyOf),spec.md,spec.yaml,expression_language.md,relational_semantics.md, and the examples indocs/index.mdandexamples/.validate.pyreadsnonportable_dialects; a document that still writesdialectsfails schema validation ("Additional properties are not allowed ('dialects' was unexpected)").OssieExpression.dialectsbecomesOssieExpression.nonportable_dialects..ostscripts, the portability fixtures (M0 to M8) and the grader use the new key.spec.mdchangelog (0.3.0.dev0) and a row indocs/spec_changes.md.What does not change
dialect,expression) and the dialect tokens.sqlor the list must be present, so an expression with only the list is still valid.sqlis authoritative over anOSSIE_SQL_2026entry in the list. Whether such an entry should still be allowed there is a separate question and not part of this PR.extensions/dialects.md, thedialectfield of an entry, the validator's internal names, and the notes about the root-leveldialectsarray that fix(core-spec): drop root-level dialects and vendors from the schema #397 removed.Impact
0.3.0.dev0. Documents rename one key; nothing else in them changes.Validation
validation/tests: 1104 passed, 1 skipped.python/tests: 345 passed.scripts/tests: 15 passed.compliance: 58 passed.ostunit tests: 182 passed;ost tests/scriptsand the compliance query scripts exit 0.validation/test_validate.py: OK.validate.pygives the same result as on main for every file underexamples/and every portability fixture.nonportable_extensionstakes, measured over the document's text. The key is longer, so that share in the test model goes from 13.7% to 12.8%.ruff formatrewrapped a few statements in files this PR touches, where the longer key or earlier commits left lines unformatted.ruff checkandruff format --checkpass.Related Issues
dev@ discussion:
[DISCUSS]thread, lazy consensus until Tuesday 1 December 2026 (UTC).Follows #522 and #617.
Checklist
Specification
core-spec/and follow the existing structure[DISCUSS]thread ondev@with a stated end date, and reach lazy consensus (or pass a[VOTE]) before merge (thread open until 2026-12-01)docs/spec_changes.mdrecords rationale, compatibility and migration impact, or the PR explains why no entry is neededConverters
Validation
validation/are updated if the spec changedDocumentation
docs/is updated to reflect any user-facing changesExamples
examples/are added or updated for any new spec constructsTests
pytest/ CI green)Compliance