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: Fix regression introduced in #20893 #21743

Merged
merged 1 commit into from
Oct 13, 2022

Conversation

john-bodley
Copy link
Member

@john-bodley john-bodley commented Oct 8, 2022

SUMMARY

This PR fixes a regression introduced in #20893 where when fetching the extra table metadata the query should be restricted to the database in question given that schema/table names aren't unique across databases.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

CI, i.e., existing integration 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 Oct 8, 2022

Codecov Report

Merging #21743 (19881c4) into master (aef6217) will decrease coverage by 1.45%.
The diff coverage is 80.48%.

❗ Current head 19881c4 differs from pull request most recent head 0846b44. Consider uploading reports for the commit 0846b44 to get more accurate results

@@            Coverage Diff             @@
##           master   #21743      +/-   ##
==========================================
- Coverage   66.84%   65.39%   -1.46%     
==========================================
  Files        1800     1800              
  Lines       68945    68957      +12     
  Branches     7335     7335              
==========================================
- Hits        46086    45092     -994     
- Misses      20966    21972    +1006     
  Partials     1893     1893              
Flag Coverage Δ
hive ?
mysql 78.25% <93.33%> (+<0.01%) ⬆️
postgres 78.31% <93.33%> (+<0.01%) ⬆️
presto ?
python 78.44% <93.33%> (-3.01%) ⬇️
sqlite 76.80% <93.33%> (+<0.01%) ⬆️
unit ?

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

Impacted Files Coverage Δ
superset-frontend/src/embedded/index.tsx 0.00% <0.00%> (ø)
superset/views/core.py 76.06% <ø> (ø)
...-frontend/src/components/FilterableTable/index.tsx 72.63% <75.00%> (ø)
superset/db_engine_specs/__init__.py 84.52% <80.00%> (-0.29%) ⬇️
...ackages/superset-ui-switchboard/src/switchboard.ts 100.00% <100.00%> (ø)
superset/config.py 91.63% <100.00%> (+0.02%) ⬆️
superset/connectors/sqla/models.py 89.87% <100.00%> (-0.82%) ⬇️
superset/superset_typing.py 98.18% <100.00%> (ø)
superset/utils/core.py 88.04% <100.00%> (-2.29%) ⬇️
superset/tables/schemas.py 0.00% <0.00%> (-100.00%) ⬇️
... and 61 more

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

@john-bodley john-bodley requested review from ktmud and etr2460 October 10, 2022 18:23
@john-bodley john-bodley marked this pull request as ready for review October 10, 2022 18:24
@john-bodley john-bodley changed the title fix: Include database filter when fetching table extra dict fix: Fix regression introduced in #20893 Oct 10, 2022
Copy link
Member

@etr2460 etr2460 left a comment

Choose a reason for hiding this comment

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

i assume sqlalchemy filter is AND by default? I thought you needed to use the _and function or something usually?

You have CI as your test plan, is there anyway to write a unit test for this? Or can you test locally to ensure this works?

Copy link
Member

@etr2460 etr2460 left a comment

Choose a reason for hiding this comment

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

ah:

Multiple criteria may be specified as comma separated; the effect is that they will be joined together using the and_() function:

from https://docs.sqlalchemy.org/en/14/orm/query.html#sqlalchemy.orm.Query.filter

i'll stamp, but a full test plan would be nice

@john-bodley
Copy link
Member Author

Thanks for the review @etr2460. I updated the testing instructions per your request.

@john-bodley john-bodley merged commit 3936e9e into master Oct 13, 2022
@john-bodley john-bodley deleted the john-bodley--fix-tables-include-database-id branch October 13, 2022 01:31
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 labels Mar 13, 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/XS 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants