Skip to content

test(compliance): add an M5 variant that composes through AGG(dataset.metric) - #758

Open
MrBlack1995 wants to merge 1 commit into
apache:mainfrom
MrBlack1995:test/portability-m5-agg
Open

MrBlack1995 wants to merge 1 commit into
apache:mainfrom
MrBlack1995:test/portability-m5-agg

Conversation

@MrBlack1995

@MrBlack1995 MrBlack1995 commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The follow-up suggested in the #631 review: an M5 variant that tests real composition. Since #703 a model-scoped metric may evaluate a dataset-scoped metric with AGG(dataset.metric) (core-spec/spec.md, Metric Scoping rule 6), so M5.agg_ref composes the same avg_order_value that way:

datasets:
  - name: sales
    metrics:
      - {name: total_amount, ... SUM(amount)}
      - {name: order_count,  ... COUNT(order_id)}
metrics:
  - name: avg_order_value
    ... AGG(sales.total_amount) / NULLIF(AGG(sales.order_count), 0)
  • Tagged OSSIE_SQL_2026, since AGG is defined there only. It keeps the primary's NULLIF, so both forms are NULL when there are no orders.
  • The inlined fixture stays the primary; the new one has the role composition-form. The M5 comment, the manifest construct and the README row now describe both.

Validation

  • m5_agg_ref.ossie.yaml passes validation/validate.py; replacing AGG(sales.total_amount) with AGG(sales.amount) fails with the validator's "names a field" error, so the fixture uses the rule as the validator enforces it. All 14 fixtures on this branch validate.
  • The compliance tests pass (51) on current main. The identity test grades every element of the new fixture PORTABLE. A new test pins that a converter which expands the AGG into the base metric's expression grades as review, since the grader cannot prove the two equal.
  • No grader change.

Related Issues

Follows #631 (suggested in its review) and #703. Refs apache/ossie-converters#24. Independent of #700, #756 and #757.

….metric)

Since apache#703 a model-scoped metric may evaluate a dataset-scoped metric with
AGG(dataset.metric). M5.agg_ref composes the same avg_order_value from two
dataset-scoped base metrics that way, tagged OSSIE_SQL_2026, next to the
inlined primary. A converter that expands the AGG grades as review.

Co-authored-by: Isaac <no-reply@databricks.com>
@MrBlack1995
MrBlack1995 force-pushed the test/portability-m5-agg branch from 3f5a7d3 to 7d5b0fa Compare November 19, 2026 05:27
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