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: deprecate restricted metrics #8197

Merged
merged 3 commits into from
Sep 10, 2019

Conversation

mistercrunch
Copy link
Member

An early community contribution added the concept of restricted metrics.

The idea was to allow for some metrics to be restricted, and if a metric
was tagged as such, a user would need to be given access to that metric
more explicitely, through a special perm we would maintain for that
metric.

Now since the new concept of "Adhoc Metrics", the popover that lets a
user pick a column and an aggregate function or to write their own SQL
expression inline, this restriction is completely bypassed. Adhoc
metrics was developed without the restricted metrics in mind.

Anyhow, in the near future, we'll be rethinking the ideas behind
data-access permissions, and things like column-level or row-level
security will be redesigned from scratch.

By deprecating this feature, we're removing a confusing and mostly broken
feature, and making it easy to move forward

Copy link
Member

@john-bodley john-bodley left a comment

Choose a reason for hiding this comment

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

Thanks @mistercrunch. I agree with this approach.



def upgrade():
op.drop_column("metrics", "is_restricted")
Copy link
Member

Choose a reason for hiding this comment

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

I think you need to use op.batch_alter_table to satisfy SQLite.

An early community contribution added the concept of restricted metrics.

The idea was to allow for some metrics to be restricted, and if a metric
was tagged as such, a user would need to be given access to that metric
more explicitely, through a special perm we would maintain for that
metric.

Now since the new concept of "Adhoc Metrics", the popover that lets a
user pick a column and an aggregate function or to write their own SQL
expression inline, this restriction is completely bypassed. Adhoc
metrics was developed without the restricted metrics in mind.

Anyhow, in the near future, we'll be rethinking the ideas behind
data-access permissions, and things like column-level or row-level
security will be redesigned from scratch.

By deprecating this feature, we're removing a confusing and mostly broken
feature, and making it easy to move forward
@mistercrunch mistercrunch force-pushed the dep_restricted_metrics branch from eae1947 to ff5be2e Compare September 9, 2019 23:41
@@ -10,7 +10,7 @@
"scripts": {
"tdd": "jest --watch",
"test": "jest",
"cover": "jest --maxWorkers=8 --coverage",
"cover": "jest --coverage",
Copy link
Member Author

Choose a reason for hiding this comment

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

unrelated to this PR, but this seems to help quite a bit with broken JS builds. For reference, not specifying maxWorkers will lead to use all CPUs cores on the box minus one

@mistercrunch mistercrunch marked this pull request as ready for review September 10, 2019 00:20
@mistercrunch mistercrunch merged commit 9d4b955 into apache:master Sep 10, 2019
@mistercrunch mistercrunch deleted the dep_restricted_metrics branch September 10, 2019 00:20
@codecov-io
Copy link

Codecov Report

Merging #8197 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8197      +/-   ##
==========================================
+ Coverage   66.16%   66.17%   +<.01%     
==========================================
  Files         479      479              
  Lines       22920    22897      -23     
  Branches     2524     2524              
==========================================
- Hits        15164    15151      -13     
+ Misses       7622     7612      -10     
  Partials      134      134
Impacted Files Coverage Δ
superset/connectors/druid/views.py 69.12% <ø> (+1.38%) ⬆️
superset/connectors/sqla/views.py 66.95% <ø> (+1.66%) ⬆️
superset/connectors/sqla/models.py 84.26% <ø> (ø) ⬆️
superset/connectors/base/models.py 90% <ø> (-0.06%) ⬇️
superset/exceptions.py 100% <ø> (ø) ⬆️
superset/security.py 74.08% <ø> (+0.08%) ⬆️
superset/connectors/druid/models.py 81.67% <100%> (+0.01%) ⬆️

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 7546ea3...ff5be2e. Read the comment docs.

@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