8000 [MLv2] Keep order-by in sync when replacing breakouts by snoe · Pull Request #31165 · metabase/metabase · GitHub
[go: up one dir, main page]

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

[MLv2] Keep order-by in sync when replacing breakouts #31165

Merged
merged 2 commits into from
Jun 1, 2023

Conversation

snoe
Copy link
Contributor
@snoe snoe commented May 30, 2023

Fixes #30980

In MLv1 breakout that were ordered by the user were kept in sync when changing the bucket or binning on a breakout. Order by was also removed if the field changed or if the breakout was removed.

This maintains the behavior.

@snoe snoe added Type:Bug Product defects .Backend .metabase-lib Label for tracking all issues related to the shared CLJC metabase-lib .Team/QueryProcessor 🛠️ labels May 30, 2023
@snoe snoe requested a review from a team May 30, 2023 17:43
@snoe snoe self-assigned this May 30, 2023
@deploysentinel
Copy link
deploysentinel bot commented May 30, 2023

No failed tests 🎉

@codecov
Copy link
codecov bot commented May 30, 2023

Codecov Report

Patch coverage: 90.90% and project coverage change: -0.01 ⚠️

Comparison is base (453ab0e) 72.56% compared to head (a1c8c12) 72.56%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #31165      +/-   ##
==========================================
- Coverage   72.56%   72.56%   -0.01%     
==========================================
  Files        2910     2910              
  Lines      102117   102167      +50     
  Branches    12811    12816       +5     
==========================================
+ Hits        74102    74137      +35     
- Misses      22301    22311      +10     
- Partials     5714     5719       +5     
Flag Coverage Δ
back-end 86.62% <90.90%> (-0.02%) ⬇️
front-end 57.24% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/metabase/lib/remove_replace.cljc 94.20% <90.90%> (-0.12%) ⬇️

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

q4 (lib/replace-clause q3 (first (lib/breakouts q3)) month)]
(is (= :day (:temporal-unit (second (last (first (lib/order-bys q3)))))))
(is (= :month (:temporal-unit (second (last (first (lib/order-bys q4)))))))))
(testing "Binning should keep in order-by in sync"
Copy link
Member

Choose a reason for hiding this comment

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

It's a little hard to read big 110 line tests like this and even harder to debug them when you break something, you could have broken this out into 5 separate deftests since they're basically completely separate. I think splitting big tests out into a series of smaller ones is preferrable when it's easy to do, but since the 5 top-level testings don't share anything it would have been relatively easy

Copy link
Member
@kulyk kulyk left a comment

Choose a reason for hiding this comment

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

Can confirm the issue is fixed, nice work!

@snoe snoe merged commit e6a58ad into master Jun 1, 2023
@snoe snoe deleted the metabase-lib-2-replace-order-by-for-breakouts branch June 1, 2023 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.Backend .metabase-lib Label for tracking all issues related to the shared CLJC metabase-lib Type:Bug Product defects
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[MLv2] [Bug] Clauses using breakout columns are not updating on bucket change
3 participants
0