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: simply is_adhoc_metric #10964

Merged
merged 2 commits into from
Sep 20, 2020
Merged

Conversation

villebro
Copy link
Member

@villebro villebro commented Sep 19, 2020

SUMMARY

Currently the is_adhoc_metric utility function checks can fail for a metric that has been defined with {"expressionType": "SIMPLE", "aggregate": None}, which is supported by certain analytical databases and works on Superset 0.36.0 but not 0.37.x. In the future we should introduce TypedDict to enforce these datastructures, perform a migration on the chart metadata to ensure all metadata is compliant (potentially even introduce a metadata data quality checker) and make the metric modal more strict about what types of aggregation options are possible.

TEST PLAN

ADDITIONAL INFORMATION

)
and metric.get("label")
)
if isinstance(metric, dict):
Copy link
Member

Choose a reason for hiding this comment

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

nit: you can just return isinstance(metric, dict)

@codecov-commenter
Copy link

codecov-commenter commented Sep 20, 2020

Codecov Report

Merging #10964 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #10964   +/-   ##
=======================================
  Coverage   65.80%   65.80%           
=======================================
  Files         815      815           
  Lines       38327    38324    -3     
  Branches     3600     3600           
=======================================
- Hits        25221    25220    -1     
+ Misses      13002    13000    -2     
  Partials      104      104           
Flag Coverage Δ
#cypress 56.68% <ø> (-0.03%) ⬇️
#javascript 61.75% <ø> (ø)
#python 61.45% <100.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
superset/utils/core.py 89.42% <100.00%> (-0.05%) ⬇️
...rontend/src/SqlLab/components/QueryAutoRefresh.jsx 65.90% <0.00%> (-6.82%) ⬇️
...set-frontend/src/dashboard/util/getDropPosition.js 93.65% <0.00%> (+1.58%) ⬆️
...et-frontend/src/dashboard/components/Dashboard.jsx 89.41% <0.00%> (+4.70%) ⬆️

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 557a303...6f18e3c. Read the comment docs.

@villebro villebro merged commit 3d8f757 into apache:master Sep 20, 2020
@villebro villebro deleted the villebro/fix-metric-label branch September 20, 2020 10:23
ranjitpatra added a commit to ranjitpatra/incubator-superset that referenced this pull request Sep 20, 2020
fix: simply is_adhoc_metric (apache#10964)
villebro added a commit that referenced this pull request Sep 21, 2020
* fix: simply is_adhoc_metric

* address comment
@dpgaspar dpgaspar added the v0.38 label Sep 22, 2020
dpgaspar pushed a commit that referenced this pull request Sep 22, 2020
* fix: simply is_adhoc_metric

* address comment
amitmiran137 pushed a commit to ofekisr/incubator-superset that referenced this pull request Sep 22, 2020
…l_access/dashboard_by_id_endpoints

* upstream/master: (29 commits)
  fix(presto): default unknown types to string type (apache#10753)
  feat(row-level-security): add base filter type and filter grouping (apache#10946)
  docs: add gallery screenshot & link in README (apache#10988)
  docs: add a "Gallery" page (apache#10968)
  build: add PR lint action (apache#10990)
  adding filters back that caused issues (apache#10989)
  chore: selectors refactor in SQLLab test suite (Cypress) (apache#10944)
  ESLint: Remove ts-ignore comments (apache#10933)
  style: fix checkbox color (apache#10970)
  fix: changed disabled rules in datasets module (apache#10979)
  fix: update the time filter for 'Last Year' option in explore (apache#10829)
  fix: use nullpool even for user lookup in the celery (apache#10938)
  Allow empty observations in alerting (apache#10939)
  fix: re-enabling several globally disabled lint rules (apache#10957)
  fix: setting specific exceptions common/query_context.py (apache#10942)
  Pylint disabled rule `pointless-string-statement` is not raising warining anymore - removing (apache#10975)
  fix: pylint disabled rules in dashboard/api.py (apache#10976)
  fix: removed disabled lint rule `too-many-locals` in connectors/base/models.py (apache#10958)
  ESLint: Re-enable rule no-access-state-in-setstate (apache#10870)
  fix: simply is_adhoc_metric (apache#10964)
  ...
auxten pushed a commit to auxten/incubator-superset that referenced this pull request Nov 20, 2020
* fix: simply is_adhoc_metric

* address comment
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
* fix: simply is_adhoc_metric

* address comment
@mistercrunch mistercrunch added 🍒 0.37.2 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.38.0 labels Mar 12, 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/S v0.37 v0.37.2 v0.38 🍒 0.37.2 🚢 0.38.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HTTP 500 + stacktrace regression (from 0.36 to 0.37.1)
4 participants