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

refactor: Add "is_select_query" method to base engine spec to unlock non-SQL dialects #15013

Merged
merged 1 commit into from Jun 8, 2021
Merged

refactor: Add "is_select_query" method to base engine spec to unlock non-SQL dialects #15013

merged 1 commit into from Jun 8, 2021

Conversation

Ceridan
Copy link
Contributor

@Ceridan Ceridan commented Jun 7, 2021

SUMMARY

We add is_select_query method to the superset/db_engine_specs/base.py to allow override it in the inherited specs.

Reason:
We are working on the SQLAlchemy Kusto dialect (Azure Data Explorer) and want to propose the support of this dialect in Superset. The current problem is that KQL (Kusto Query Language) doesn't use "SELECT" keyword for queries, it is started from the table name instead. If we want to allow SQLLabs limits UI component to working properly, we need to have the ability to define which query is essentially the SELECT-query in our db engine spec file.

More details in the issue: #15011

TESTING INSTRUCTIONS

The functionality is still the same. Actually, you may just run any query in the SQLLab and verify that the limit (UI component) is still applying.

ADDITIONAL INFORMATION

  • Has associated issue: Determination of the select queries in BaseEngineSpec #15011
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

Copy link
Member

@betodealmeida betodealmeida left a comment

Choose a reason for hiding this comment

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

This is great, it's nice to have these abstractions to support more exotic dialects.

@codecov
Copy link

codecov bot commented Jun 8, 2021

Codecov Report

Merging #15013 (2cb882e) into master (f94c6d2) will decrease coverage by 0.23%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #15013      +/-   ##
==========================================
- Coverage   77.62%   77.39%   -0.24%     
==========================================
  Files         965      965              
  Lines       49521    49524       +3     
  Branches     6263     6263              
==========================================
- Hits        38442    38328     -114     
- Misses      10878    10995     +117     
  Partials      201      201              
Flag Coverage Δ
hive ?
mysql 81.63% <100.00%> (+<0.01%) ⬆️
postgres 81.66% <100.00%> (+<0.01%) ⬆️
presto ?
python 81.74% <100.00%> (-0.45%) ⬇️
sqlite 81.27% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
superset/db_engine_specs/base.py 87.97% <100.00%> (-0.34%) ⬇️
superset/sql_lab.py 81.90% <100.00%> (ø)
superset/db_engines/hive.py 0.00% <0.00%> (-82.15%) ⬇️
superset/db_engine_specs/hive.py 70.32% <0.00%> (-17.08%) ⬇️
superset/db_engine_specs/presto.py 83.36% <0.00%> (-6.95%) ⬇️
superset/views/database/mixins.py 81.03% <0.00%> (-1.73%) ⬇️
superset/connectors/sqla/models.py 88.15% <0.00%> (-1.66%) ⬇️
superset/models/core.py 89.73% <0.00%> (-0.27%) ⬇️
superset/utils/core.py 88.91% <0.00%> (-0.13%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f94c6d2...2cb882e. Read the comment docs.

@betodealmeida
Copy link
Member

Thanks for working on this, @Ceridan!

@betodealmeida betodealmeida merged commit 11eef25 into apache:master Jun 8, 2021
@Ceridan Ceridan deleted the engine-choose-if-select branch June 8, 2021 07:14
amitmiran137 added a commit to nielsen-oss/superset that referenced this pull request Jun 8, 2021
* upstream/master:
  fix(explore): Datepicker glitch on hover outside the modal (apache#15033)
  Add ming-height to empty tab (apache#14878)
  Remove nowrap (apache#14954)
  display all metric results in editor (apache#15031)
  feat: Add "is_select_query" method to base engine spec to make it possible to override it (apache#15013)
  fix(dashboard): custom css should be removed on unmount (apache#15025)
  feat(filter-box): hide druid options if druid not enabled (apache#14921)
  fix: adding additional configs and colors for queryHistory (apache#14995)
  chore: rename 'Source' to 'Database' for consistency (apache#15021)
  chore(ci): fix ci conflict (apache#15016)
  fix(native-filters): avoid double load on initialization (apache#15012)
  feat(native-filters): Support default to first value in select filter (apache#14869)
  docs: required information for OAuth2 configuration (apache#15010)
  Update index.mdx (apache#14990)
cccs-RyanS pushed a commit to CybercentreCanada/superset that referenced this pull request Dec 17, 2021
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.3.0 labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/S 🚢 1.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants