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(trino): handle missing db in migration #29997

Merged
merged 2 commits into from
Aug 22, 2024

Conversation

villebro
Copy link
Member

SUMMARY

When running superset db upgrade on my local devenv, the 87ffc36f9842 migration errored out on the following Trino connection string: trino://trino@localhost:8081.

AFTER

executes successfully

BEFORE

  File "/Users/ville/apple/apache-superset/superset/migrations/versions/2024-05-09_18-44_87ffc36f9842_enable_catalog_in_bigquery_presto_trino_.py", line 36, in upgrade
    upgrade_catalog_perms(engines={"trino", "presto", "bigquery", "snowflake"})
  File "/Users/ville/apple/apache-superset/superset/migrations/shared/catalogs.py", line 384, in upgrade_catalog_perms
    if default_catalog := database.get_default_catalog():
  File "/Users/ville/apple/apache-superset/superset/models/core.py", line 580, in get_default_catalog
    return self.db_engine_spec.get_default_catalog(self)
  File "/Users/ville/apple/apache-superset/superset/db_engine_specs/presto.py", line 306, in get_default_catalog
    return database.url_object.database.split("/")[0]
AttributeError: 'NoneType' object has no attribute 'split'

TESTING INSTRUCTIONS

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

@dosubot dosubot bot added the data:connect:trino Related to Trino label Aug 22, 2024
Copy link

codecov bot commented Aug 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.68%. Comparing base (76d897e) to head (1174e6a).
Report is 1094 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #29997       +/-   ##
===========================================
+ Coverage   60.48%   83.68%   +23.19%     
===========================================
  Files        1931      528     -1403     
  Lines       76236    38134    -38102     
  Branches     8568        0     -8568     
===========================================
- Hits        46114    31911    -14203     
+ Misses      28017     6223    -21794     
+ Partials     2105        0     -2105     
Flag Coverage Δ
hive 48.97% <66.66%> (-0.20%) ⬇️
javascript ?
mysql 76.75% <33.33%> (?)
postgres 76.82% <33.33%> (?)
presto 53.52% <66.66%> (-0.28%) ⬇️
python 83.68% <100.00%> (+20.19%) ⬆️
sqlite 76.29% <33.33%> (?)
unit 60.33% <100.00%> (+2.71%) ⬆️

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.

@villebro villebro force-pushed the villebro/missing-default-cat branch from 3773a8e to 1174e6a Compare August 22, 2024 21:31
@villebro villebro merged commit 17eecb1 into apache:master Aug 22, 2024
37 checks passed
@villebro villebro deleted the villebro/missing-default-cat branch August 22, 2024 22:53
@michael-s-molina michael-s-molina added the v4.1 Label added by the release manager to track PRs to be included in the 4.1 branch label Aug 23, 2024
sadpandajoe pushed a commit that referenced this pull request Aug 27, 2024
@github-actions github-actions bot added 🍒 4.1.0 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels labels Nov 14, 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 data:connect:trino Related to Trino size/S v4.1 Label added by the release manager to track PRs to be included in the 4.1 branch 🍒 4.1.0 🍒 4.1.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants