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

chore(security): Make get_database_perm/get_dataset_perm return optional #24046

Merged
merged 1 commit into from
Oct 31, 2023

Conversation

john-bodley
Copy link
Member

SUMMARY

Per here perms can be None and thus these return types (which could be overloaded) should be Optional[str] rather than str.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

CI.

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 May 12, 2023

Codecov Report

Merging #24046 (ae638a7) into master (97482c5) will increase coverage by 0.00%.
The diff coverage is 88.88%.

❗ Current head ae638a7 differs from pull request most recent head 08547b2. Consider uploading reports for the commit 08547b2 to get more accurate results

@@           Coverage Diff           @@
##           master   #24046   +/-   ##
=======================================
  Coverage   68.22%   68.22%           
=======================================
  Files        1941     1941           
  Lines       75261    75162   -99     
  Branches     8168     8134   -34     
=======================================
- Hits        51344    51280   -64     
+ Misses      21828    21803   -25     
+ Partials     2089     2079   -10     
Flag Coverage Δ
hive 53.17% <33.33%> (-0.01%) ⬇️
mysql 78.93% <88.88%> (-0.01%) ⬇️
postgres 79.01% <88.88%> (-0.01%) ⬇️
presto 53.09% <33.33%> (-0.01%) ⬇️
python 82.78% <88.88%> (-0.01%) ⬇️
sqlite 77.53% <88.88%> (-0.01%) ⬇️
unit 53.04% <33.33%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
...frontend/src/SqlLab/components/ResultSet/index.tsx 63.05% <ø> (+0.39%) ⬆️
...-frontend/src/components/FilterableTable/index.tsx 81.39% <ø> (+8.66%) ⬆️
superset-frontend/src/components/Table/index.tsx 71.42% <ø> (ø)
superset/security/manager.py 95.83% <88.88%> (-0.13%) ⬇️

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

@john-bodley john-bodley force-pushed the john-bodley--security-perm-return-optional branch from 2797a63 to 8d7d5c0 Compare May 12, 2023 17:02
@john-bodley john-bodley force-pushed the john-bodley--security-perm-return-optional branch from 8d7d5c0 to 08547b2 Compare May 12, 2023 17:04
@pull-request-size pull-request-size bot added size/M and removed size/S labels May 12, 2023
@john-bodley john-bodley marked this pull request as ready for review May 12, 2023 20:24
superset/security/manager.py Show resolved Hide resolved
superset/security/manager.py Show resolved Hide resolved
superset/security/manager.py Show resolved Hide resolved
@john-bodley john-bodley force-pushed the john-bodley--security-perm-return-optional branch from b8f8fcc to 08547b2 Compare October 30, 2023 23:54
@john-bodley
Copy link
Member Author

@michael-s-molina apologies for the delay in responding to your comments. Regarding replacing Optional[str] with str | None, currently the superset/security/manager.py file doesn't include the,

from __future__ import annotations

import and thus this syntax is not supported. My sense/preference is that this file (alongside others) should be updated in a different PR to keep this change to a minimum.

@john-bodley john-bodley force-pushed the john-bodley--security-perm-return-optional branch from 08547b2 to 4392911 Compare October 31, 2023 00:22
Copy link
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

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

LGTM

@john-bodley john-bodley merged commit 7804d14 into master Oct 31, 2023
56 checks passed
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
@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
sfirke pushed a commit to sfirke/superset that referenced this pull request Mar 22, 2024
@mistercrunch mistercrunch deleted the john-bodley--security-perm-return-optional branch March 26, 2024 18:06
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/M 🚢 3.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants