-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
fix: simply is_adhoc_metric #10964
Conversation
superset/utils/core.py
Outdated
) | ||
and metric.get("label") | ||
) | ||
if isinstance(metric, dict): |
There was a problem hiding this comment.
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 Report
@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
fix: simply is_adhoc_metric (apache#10964)
* fix: simply is_adhoc_metric * address comment
* fix: simply is_adhoc_metric * address comment
…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) ...
* fix: simply is_adhoc_metric * address comment
* fix: simply is_adhoc_metric * address comment
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 introduceTypedDict
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