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

feat: improve SQLite DB engine spec #24909

Merged
merged 4 commits into from
Aug 7, 2023
Merged

Conversation

betodealmeida
Copy link
Member

SUMMARY

Add more (all) time grains to the SQLite DB engine spec and also get_function_names. Function names from:

I know we don't take the SQLite DB engine spec seriously, but it's used as the base for GSheets and Shillelagh.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A

TESTING INSTRUCTIONS

Added more unit tests.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • 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

@codecov
Copy link

codecov bot commented Aug 7, 2023

Codecov Report

Merging #24909 (4fec4c2) into master (3b81538) will increase coverage by 0.00%.
The diff coverage is 88.23%.

❗ Current head 4fec4c2 differs from pull request most recent head 3b8d078. Consider uploading reports for the commit 3b8d078 to get more accurate results

@@           Coverage Diff           @@
##           master   #24909   +/-   ##
=======================================
  Coverage   68.99%   68.99%           
=======================================
  Files        1906     1906           
  Lines       74122    74134   +12     
  Branches     8208     8208           
=======================================
+ Hits        51140    51150   +10     
- Misses      20859    20861    +2     
  Partials     2123     2123           
Flag Coverage Δ
hive 54.17% <82.35%> (+<0.01%) ⬆️
mysql 79.21% <82.35%> (-0.01%) ⬇️
postgres 79.31% <82.35%> (-0.01%) ⬇️
presto 54.07% <82.35%> (+<0.01%) ⬆️
python 83.37% <88.23%> (-0.01%) ⬇️
sqlite 77.89% <88.23%> (+<0.01%) ⬆️
unit 55.05% <82.35%> (+<0.01%) ⬆️

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

Files Changed Coverage Δ
superset/db_engine_specs/shillelagh.py 87.50% <71.42%> (-12.50%) ⬇️
superset/db_engine_specs/gsheets.py 76.47% <100.00%> (-0.18%) ⬇️
superset/db_engine_specs/sqlite.py 97.22% <100.00%> (+0.55%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

assert rv.status_code == 200
assert response == {
"function_names": [
"abs",
Copy link
Member

Choose a reason for hiding this comment

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

wdyt about defining this list as a separate variable in the db engine spec and then importing it here, or do you want this to be explicitly updated here when the original list is updated?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I tend to avoid comparing results to imported variables in unit tests, since it can lead to mistakes.

Copy link
Member

@eschutho eschutho 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!

@betodealmeida betodealmeida merged commit 85a7d5c into master Aug 7, 2023
54 checks passed
@michael-s-molina
Copy link
Member

michael-s-molina commented Aug 8, 2023

I know we don't take the SQLite DB engine spec seriously, but it's used as the base for GSheets and Shillelagh.

SQLite is the default database for Superset and does not require additional dependencies/installation steps, which is really helpful for first time contributors or people that want to quickly test the application. This PR is really important. Thanks!

"""
Return function names.
"""
return [
Copy link
Member

Choose a reason for hiding this comment

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

@betodealmeida I'm somewhat surprised sqlite3 doesn't provide these.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I wish it exposed more of the internals of SQLite!

@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 3.1.0 labels Mar 8, 2024
@mistercrunch mistercrunch deleted the update_sqlite_specs branch March 26, 2024 18:02
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/L 🚢 3.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants