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

Add limit option for MSSQL query runner #6704

Merged
merged 3 commits into from
Feb 26, 2024

Conversation

dvandonkelaar
Copy link
Contributor

What type of PR is this?

  • Refactor
  • Feature
  • Bug Fix
  • New Query Runner (Data Source)
  • New Alert Destination
  • Other

Description

The limit query adds LIMIT 1000 to the end of the query, but this isn't working for MSSQL queries.
This change adds the possibility to add the query runner specified limit text after the SELECT statement, based on the limit_after_select variable.

How is this tested?

  • Unit tests (pytest, jest)
  • E2E Tests (Cypress)
  • Manually
  • N/A

Related Tickets & Documents

This issue is also discussed in #5773. No other issues

Mobile & Desktop Screenshots/Recordings (if there are UI changes)

N/A

@justinclift
Copy link
Member

Thanks for this @dvandonkelaar. It looks like this needs some formatting tweaks in order to pass the CI testing though.

Are you ok to get that fixed?

@dvandonkelaar
Copy link
Contributor Author

dvandonkelaar commented Jan 15, 2024

Thanks for the quick reply! My apologies, apparently I ignored the non-installed linter errors.
Commint 7e63a0f fixes the errors.

Copy link

codecov bot commented Feb 26, 2024

Codecov Report

Attention: Patch coverage is 62.50000% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 63.41%. Comparing base (2fe0326) to head (9f26303).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6704      +/-   ##
==========================================
- Coverage   63.42%   63.41%   -0.01%     
==========================================
  Files         162      162              
  Lines       13173    13186      +13     
  Branches     1819     1822       +3     
==========================================
+ Hits         8355     8362       +7     
- Misses       4522     4527       +5     
- Partials      296      297       +1     
Files Coverage Δ
redash/query_runner/mssql.py 34.56% <100.00%> (+2.51%) ⬆️
redash/query_runner/mssql_odbc.py 36.14% <100.00%> (+2.39%) ⬆️
redash/query_runner/__init__.py 76.63% <40.00%> (-1.39%) ⬇️

Copy link
Member

@justinclift justinclift left a comment

Choose a reason for hiding this comment

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

Looks good to me, and we can ignore the minor codecov problem in this instance. 😄

@justinclift justinclift merged commit 81d22f1 into getredash:master Feb 26, 2024
13 of 15 checks passed
@justinclift
Copy link
Member

@dvandonkelaar Thanks for getting this done, it fixes an important bug with the MSSQL driver. 😄

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