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

Prevent 'main' database connection creation #8038

Merged
merged 5 commits into from
Sep 8, 2019

Conversation

mistercrunch
Copy link
Member

CATEGORY

Choose one

  • Bug Fix
  • Enhancement (new features, refinement)
  • Refactor
  • Add tests
  • Build / Development Environment
  • Documentation

SUMMARY

In #7773, we created a new connection model instance to load and connect to examples. This PR build upon this PR and removes the need for a main database connection to the metadata database. Note that this main connection database still get created for unit testing purposes, but that should probably get deprecated in favor of leveraging the examples database for unit tests.

TEST PLAN

Have the current unit test suite succeed (lots of existing tests had to be altered)

@codecov-io
Copy link

codecov-io commented Sep 3, 2019

Codecov Report

Merging #8038 into master will increase coverage by 7.6%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8038      +/-   ##
==========================================
+ Coverage   66.06%   73.67%    +7.6%     
==========================================
  Files         479      115     -364     
  Lines       22930    12036   -10894     
  Branches     2524        0    -2524     
==========================================
- Hits        15148     8867    -6281     
+ Misses       7648     3169    -4479     
+ Partials      134        0     -134
Impacted Files Coverage Δ
superset/utils/core.py 87.95% <ø> (-0.11%) ⬇️
superset/security.py 74% <0%> (-0.3%) ⬇️
superset/views/core.py 71.03% <0%> (-0.22%) ⬇️
superset/cli.py 34.09% <100%> (-3.25%) ⬇️
superset/assets/src/components/Checkbox.jsx
...ations/deckgl/layers/Polygon/PolygonChartPlugin.js
.../assets/src/dashboard/reducers/dashboardFilters.js
...ets/src/dashboard/components/dnd/DragDroppable.jsx
...c/visualizations/deckgl/layers/Polygon/Polygon.jsx
... and 361 more

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 ee24539...ee0614f. Read the comment docs.

@villebro
Copy link
Member

villebro commented Sep 3, 2019

Will review shortly

data = self.get_json_resp("/superset/search_queries?database_id=1")
data = self.get_json_resp(
f"/superset/search_queries?database_id={examples_dbid}"
)
Copy link
Member

Choose a reason for hiding this comment

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

👍

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

LGTM, however didn't test locally, so if testing help is needed let me know. I'm personally a big fan of having the main db automatically available, but that may be because I'm just used to the status quo. But perhaps a note in the changelog would be appropriate to inform users that it's no longer created automatically.

@mistercrunch
Copy link
Member Author

if your examples database connection string happens to be the same as the metadata database one, it'll effectively be the same as it used to be, except for the the connection label

@mistercrunch mistercrunch merged commit 68c4c3a into apache:master Sep 8, 2019
@mistercrunch mistercrunch deleted the main_db_not_needed branch September 8, 2019 17:18
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.35.0 labels Feb 28, 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/L 🚢 0.35.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants