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: remove expose #19700

Merged
merged 2 commits into from
Apr 17, 2022
Merged

fix: remove expose #19700

merged 2 commits into from
Apr 17, 2022

Conversation

AAfghahi
Copy link
Member

SUMMARY

When creating a filter for the Database Filter view we thought that we would have to add individual filters into the search_filter column. But we learned that we don't. This is cleaning that up.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

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

@codecov
Copy link

codecov bot commented Apr 13, 2022

Codecov Report

Merging #19700 (c5cb7c2) into master (ac2c66c) will decrease coverage by 0.18%.
The diff coverage is 60.00%.

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

@@            Coverage Diff             @@
##           master   #19700      +/-   ##
==========================================
- Coverage   66.51%   66.32%   -0.19%     
==========================================
  Files        1686     1686              
  Lines       64589    64586       -3     
  Branches     6635     6635              
==========================================
- Hits        42959    42835     -124     
- Misses      19931    20052     +121     
  Partials     1699     1699              
Flag Coverage Δ
hive ?
mysql 81.95% <100.00%> (-0.01%) ⬇️
postgres 82.00% <100.00%> (-0.01%) ⬇️
presto ?
python 82.04% <100.00%> (-0.39%) ⬇️
sqlite ?
unit ?

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

Impacted Files Coverage Δ
...c/views/CRUD/data/database/DatabaseModal/index.tsx 31.80% <0.00%> (ø)
...ontrols/DndColumnSelectControl/DndColumnSelect.tsx 38.09% <100.00%> (ø)
superset/databases/api.py 94.01% <100.00%> (ø)
superset/databases/filters.py 100.00% <100.00%> (ø)
superset/db_engines/hive.py 0.00% <0.00%> (-85.19%) ⬇️
superset/db_engine_specs/hive.py 70.11% <0.00%> (-15.71%) ⬇️
superset/db_engine_specs/sqlite.py 91.89% <0.00%> (-5.41%) ⬇️
superset/db_engine_specs/presto.py 83.64% <0.00%> (-5.39%) ⬇️
superset/utils/celery.py 86.20% <0.00%> (-3.45%) ⬇️
superset/connectors/sqla/utils.py 88.76% <0.00%> (-2.25%) ⬇️
... and 11 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 ac2c66c...4bfc546. Read the comment docs.

@yousoph
Copy link
Member

yousoph commented Apr 14, 2022

/testenv up

@github-actions
Copy link
Contributor

@yousoph Ephemeral environment spinning up at http://54.214.138.182:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@AAfghahi AAfghahi force-pushed the arash/search_filter branch 2 times, most recently from d20b3fa to d5ba9b4 Compare April 15, 2022 16:48
@yousoph
Copy link
Member

yousoph commented Apr 15, 2022

/testenv up

@github-actions
Copy link
Contributor

@yousoph Ephemeral environment spinning up at http://35.161.23.73:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@AAfghahi
Copy link
Member Author

/testenv up

@github-actions
Copy link
Contributor

@AAfghahi Ephemeral environment spinning up at http://35.86.101.99:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@AAfghahi AAfghahi force-pushed the arash/search_filter branch 2 times, most recently from 70cd797 to 9a31753 Compare April 15, 2022 17:23
@jinghua-qa
Copy link
Member

Tested in the ephemeral env, when i try to save the change to allow data upload in db setting , error msg will show and change can not be made.
Screen Shot 2022-04-15 at 11 24 16 AM

@jinghua-qa
Copy link
Member

Tested in the ephemeral env, when i try to save the change to allow data upload in db setting , error msg will show and change can not be made. Screen Shot 2022-04-15 at 11 24 16 AM

This is due to the sqlite in ephermal env, will test again locally

@jinghua-qa
Copy link
Member

Tested PR locally and it worked as expected

Screen.Recording.2022-04-15.at.12.08.31.PM.mov

@@ -69,8 +69,6 @@ class DatabaseUploadEnabledFilter(BaseFilter): # pylint: disable=too-few-public
def apply(self, query: Query, value: Any) -> Query:
filtered_query = query.filter(Database.allow_file_upload)

database_perms = security_manager.user_view_menu_names("database_access")
schema_access_databases = can_access_databases("schema_access")
Copy link
Member

@eschutho eschutho Apr 15, 2022

Choose a reason for hiding this comment

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

if I compare this filter to the actual csv file upload validator, the validator checks for
security_manager.can_access_database(database)
and
schema in database.get_schema_access_for_file_upload() We're covering the latter in lines 74 - 88, and I'm assuming that datasource_access_databases = can_access_databases("datasource_access") should return the same as the former check in the validator.

@jinghua-qa jinghua-qa merged commit 57157c8 into apache:master Apr 17, 2022
@github-actions
Copy link
Contributor

Ephemeral environment shutdown and build artifacts deleted.

sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Apr 18, 2022
* bumping shillelagh

* remove expose

(cherry picked from commit 57157c8)
@sadpandajoe
Copy link
Member

🏷️ preset:2022.15

philipher29 pushed a commit to ValtechMobility/superset that referenced this pull request Jun 9, 2022
* bumping shillelagh

* remove expose
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.0.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 preset:2022.15 size/S 🚢 2.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants