Skip to content

fix(compliance): count a changed returned sql against an ANSI-only input; an empty return drops its elements - #757

Merged
jbonofre merged 2 commits into
apache:mainfrom
MrBlack1995:fix/grader-sql-changed-and-empty-return
Nov 18, 2026
Merged

jbonofre merged 2 commits into
apache:mainfrom
MrBlack1995:fix/grader-sql-changed-and-empty-return

Conversation

@MrBlack1995

@MrBlack1995 MrBlack1995 commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The grader follow-up promised on #642, now that #631 has landed. Two cases:

1. A changed sql hidden by an unchanged copy (the note on #642). With an ANSI_SQL-only input, a converter that rewrites the returned sql but passes the ANSI_SQL copy through graded PORTABLE, because the change check only looked at the authored tags:

# input
expression: {dialects: [{dialect: ANSI_SQL, expression: SUM(a)}]}
# returned: PORTABLE on main, REWRITTEN with this PR
expression:
  sql: SUM(x)
  dialects: [{dialect: ANSI_SQL, expression: SUM(a)}]

A returned sql is the authoritative OSSIE_SQL_2026 form, so it now counts as a change whenever its text differs from the authored one, whichever tags the input used.

2. An empty but valid return (from the measurement discussion on apache/ossie-converters#65). REJECTED now means no document came back: nothing, not a mapping, or {}, which is what interop/ passes when an export failed. A document with content but no elements is a return, so each element grades DROPPED, diagnosed when the converter's warnings name it.

Validation

  • The compliance tests pass (54) on current main. The two tests for the cases above fail on main; one more pins that {} stays REJECTED.
  • I graded the 120 portability cases of the latest Interop matrix run on apache/ossie-converters main (run 44250491430) with main's grader and with this one: every finding is the same. That check caught that interop/ passes {} for a failed export, which a first version of this change graded as dropped (53 findings for two converters whose export fails); {} is REJECTED now, as on main.

Related Issues

Follow-up to #642 (Chris's 11-11 note). Refs apache/ossie-converters#24. Independent of #700 and #756; the grader README line may need a trivial rebase against #756, whichever merges second.

…put; an empty return drops its elements

A returned OSSIE_SQL_2026 form is authoritative, so it is now a change
when its text differs from the authored one even if the input had only
an ANSI_SQL entry and that entry came back unchanged (review of apache#642).

REJECTED now means no document came back. A valid document with no
elements is a return, so its elements grade as dropped, diagnosed when
the converter's warnings name them.

Co-authored-by: Isaac <no-reply@databricks.com>
jbonofre
jbonofre previously approved these changes Nov 18, 2026

@jbonofre jbonofre left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @MrBlack1995!

Both changes look clean and well-scoped, and all 54 grader tests pass locally (make compliance-test).

@jbonofre
jbonofre merged commit 9bccf10 into apache:main Nov 18, 2026
4 checks passed
christianeu-db added a commit to christianeu-db/ossie-converters that referenced this pull request Nov 21, 2026
… name

The submodule's bare M0-M3 fixtures now carry their metrics at dataset
scope, so they no longer name the same metrics as the model-scoped
qualified fixtures. The tests derive the bare form from the qualified
fixture instead, as the module already does for any metric whose shape
it depends on.

The grader rejects only a missing or empty return since
apache/ossie#757, so the rejection test passes `{}`, which is what the
matrix passes when an export fails.

Co-authored-by: Isaac <no-reply@databricks.com>
christianeu-db added a commit to apache/ossie-converters that referenced this pull request Nov 23, 2026
…ble_extensions (#247)

* chore(deps): bump ossie from `ee89dbd` to `344259a`

Co-authored-by: Isaac <no-reply@databricks.com>

* test(databricks): expect the M6 ladder rung to fail, drop the M0 xfail

apache/ossie#631 adds the M6 rung (YEAR, DATE_TRUNC, DATEDIFF). It shows
two converter gaps: the round trip upper-cases the DATE_TRUNC unit, which
the grader scores as REWRITTEN, and `translate` has no verified DATABRICKS
form for DATEDIFF. Both rung tests are strict xfails until the converter
handles them.

The M0 qualified OSSIE_SQL case now passes against the sql-primary
grader, as its comment anticipated, so its xfail goes.

Co-authored-by: Isaac <no-reply@databricks.com>

* test(interop): stop pairing the bare and qualified ladder fixtures by name

The submodule's bare M0-M3 fixtures now carry their metrics at dataset
scope, so they no longer name the same metrics as the model-scoped
qualified fixtures. The tests derive the bare form from the qualified
fixture instead, as the module already does for any metric whose shape
it depends on.

The grader rejects only a missing or empty return since
apache/ossie#757, so the rejection test passes `{}`, which is what the
matrix passes when an export fails.

Co-authored-by: Isaac <no-reply@databricks.com>

* fix(converters): write nonportable_extensions with object data

apache/ossie#522 renames `custom_extensions` to `nonportable_extensions`
with no alias, and types `data` as an object instead of a JSON string.
The SDK renames `OssieCustomExtension` to `OssieNonportableExtension`
and types `data` as `dict`.

Every converter now writes and reads the new field with object data.
Where a payload may hold values JSON cannot (dates from a YAML loader),
it still goes through the converter's existing JSON encoding, now
decoded back to an object. Committed fixtures and goldens move to the
new shape.

Vendor-side formats keep their own shapes: OBML `customExtensions` data
stays a string, and Honeydew's `ossie` metadata keeps its item names.
thoughtspot keeps reading both names and both shapes, and keeps a
document that still uses the old name on it. orionbelt's v0.1 shim
migrates a legacy `custom_extensions` list before it reads it.

Tests that built a malformed JSON string cannot be constructed against
the SDK any more and are removed, along with lightdash's
EXTENSION_DATA_INVALID issue, which can no longer occur.

Co-authored-by: Isaac <no-reply@databricks.com>

* fix(databricks): translate DATEDIFF by day and keep the M6 rung portable

The M6 ladder rung (YEAR, DATE_TRUNC, DATEDIFF) did not survive a round
trip, for three reasons:

- The default parser reads Ossie's part-first DATEDIFF(day, start, end)
  end-first, with the part as a column. The Ossie parser now reads the
  part first. Only the day count is translated: the Ossie specification
  does not say whether DATEDIFF counts part boundaries or whole parts
  elapsed (Databricks), and the two agree only for the days between two
  dates.
- sqlglot upper-cases the DATE_TRUNC unit, so DATE_TRUNC('month', d)
  came back as 'MONTH'. Ossie output now writes the unit in lower case,
  as the specification does.
- The Databricks parser wraps the argument of YEAR, MONTH, DAY and
  DAYOFYEAR in a TO_DATE that was not written. The wrapper is dropped on
  parse, so YEAR(x) comes back as YEAR(x).

The M6 xfails go, as does the M0 xfail that expected the sql-primary
grader.

Co-authored-by: Isaac <no-reply@databricks.com>

* test(dbt): move the ratio helper tests to nonportable_extensions

Co-authored-by: Isaac <no-reply@databricks.com>

* fix(atlan, wisdom): write nonportable_extensions with object data

Co-authored-by: Isaac <no-reply@databricks.com>

---------

Co-authored-by: Isaac <no-reply@databricks.com>
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.

2 participants