Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MBQL lib] Hide :offset exprs in visibleColumns (and therefore filterableColumns etc.) #42736

Merged
merged 1 commit into from
May 16, 2024

Conversation

bshepherdson
Copy link
Contributor

@bshepherdson bshepherdson commented May 16, 2024

Offset expressions are what we might call "late" expressions - they only make sense at aggregation time, at the end of a query stage.

This change hides :offset expressions in visibleColumns on a stage, which means they don't appear in expressionableColumns, filterableColumns or orderableColumns. Like aggregations, they aren't "visible" within a stage, though they are returned from it. (:offset expressions appear in returnColumns, of course.)

Fixes #42725.

@metabase-bot metabase-bot bot added the .Team/QueryProcessor :hammer_and_wrench: label May 16, 2024
Copy link

replay-io bot commented May 16, 2024

Status Complete ↗︎
Commit fe30595
Results
⚠️ 1 Flaky
2507 Passed

Offset expressions in the same stage cannot be used for ordering.
Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @bshepherdson and the rest of your teammates on Graphite Graphite

@bshepherdson bshepherdson changed the title [MBQL lib] Don't suggest expressions containing :offset for order-by [MBQL lib] Hide :offset exprs in visibleColumns (and therefore filterableColumns etc.) May 16, 2024
@bshepherdson bshepherdson added the no-backport Do not backport this PR to any branch label May 16, 2024
Copy link
Contributor

@metamben metamben left a comment

Choose a reason for hiding this comment

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

LGTM

test/metabase/lib/expression_test.cljc Show resolved Hide resolved
@bshepherdson bshepherdson merged commit 06b99db into offset-custom-expressions May 16, 2024
125 of 130 checks passed
@bshepherdson bshepherdson deleted the mblib-offset-not-orderable branch May 16, 2024 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-backport Do not backport this PR to any branch .Team/QueryProcessor :hammer_and_wrench:
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants