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

fix: Render LIMIT 0 and OFFSET 0 properly in SQL templates #8781

Merged
merged 1 commit into from
Oct 9, 2024

Conversation

mcheshkov
Copy link
Member

Check List

  • Tests has been run in packages where changes made if available
  • Linter has been run for changed code
  • Tests for the changes have been added if not covered yet
  • Docs have been added / updated if required

Description of Changes Made (if issue reference is not provided)

if limit condition in Jinja will fail for both None and Some(0)
This is more or less fine for offset, but completely wrong for limit. For consistency both are changed.

Copy link

codecov bot commented Oct 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.68%. Comparing base (59dd29e) to head (4e1ca10).
Report is 4 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #8781   +/-   ##
=======================================
  Coverage   82.67%   82.68%           
=======================================
  Files         219      219           
  Lines       78127    78161   +34     
=======================================
+ Hits        64589    64624   +35     
+ Misses      13538    13537    -1     
Flag Coverage Δ
cubesql 82.68% <100.00%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

vercel bot commented Oct 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

8 Skipped Deployments
Name Status Preview Comments Updated (UTC)
examples-angular-dashboard ⬜️ Ignored (Inspect) Visit Preview Oct 9, 2024 5:18pm
examples-react-d3 ⬜️ Ignored (Inspect) Visit Preview Oct 9, 2024 5:18pm
examples-react-dashboard ⬜️ Ignored (Inspect) Visit Preview Oct 9, 2024 5:18pm
examples-react-data-table ⬜️ Ignored (Inspect) Visit Preview Oct 9, 2024 5:18pm
examples-react-highcharts ⬜️ Ignored (Inspect) Visit Preview Oct 9, 2024 5:18pm
examples-react-material-ui ⬜️ Ignored (Inspect) Visit Preview Oct 9, 2024 5:18pm
examples-react-pivot-table ⬜️ Ignored (Inspect) Visit Preview Oct 9, 2024 5:18pm
examples-vue-query-builder ⬜️ Ignored (Inspect) Visit Preview Oct 9, 2024 5:18pm

@mcheshkov mcheshkov force-pushed the sql-api-limit-template branch 2 times, most recently from bd23c96 to da70a8e Compare October 4, 2024 16:10
@mcheshkov mcheshkov marked this pull request as ready for review October 4, 2024 17:49
@mcheshkov mcheshkov requested review from a team as code owners October 4, 2024 17:49
@mcheshkov mcheshkov force-pushed the sql-api-limit-template branch 2 times, most recently from a973ce4 to 7f8e091 Compare October 4, 2024 23:49
Copy link
Member

@KSDaemon KSDaemon left a comment

Choose a reason for hiding this comment

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

👍🏻 LGTM!

`if limit` condition in Jinja will fail for both None and Some(0)
This is more or less fine for offset, but completely wrong for limit. For consistency both are changed.

Also add unit test in SQL API and smoke E2E test
@mcheshkov mcheshkov merged commit 6b17731 into master Oct 9, 2024
83 checks passed
@mcheshkov mcheshkov deleted the sql-api-limit-template branch October 9, 2024 18:29
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.

4 participants