You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/11/28 07:25:50 UTC
[GitHub] [superset] villebro opened a new pull request, #22238: fix(generic-chart-axes): apply time filter on all target columns
villebro opened a new pull request, #22238:
URL: https://github.com/apache/superset/pull/22238
### SUMMARY
When the generic chart axes feature flag is enabled, temporal filters can only be applied on numeric target columns, causing problems for databases such as Druid which stores temporal values in `LONG` format. To fix this, we should short circuit the `handle_single_value` inner function in the `filter_values_handler` of the `BaseDatasource` class and return the filter value as-is, as that should always be passed to the `get_since_until_from_time_range` in it's original format [here](https://github.com/apache/superset/blob/22fab5e58ce574e962518067d982e3036449e580/superset/connectors/sqla/models.py#L1513-L1517).
As a follow-up, we should clean up these helper functions and add proper unit tests to them (adding unit tests in the current state of this code is fairly difficult).
### AFTER
After this fix, the temporal adhoc filter applies cleanly to a non-temporal column, similarly to how id does when disabling the "GENERIC_CHART_AXES" feature flag:
<img width="882" alt="image" src="https://user-images.githubusercontent.com/33317356/204217555-2c470553-85a1-4fcb-a80b-947e126c17d8.png">
### BEFORE
Currently the chart is unable to render, returning a "Must specify a value for filters with comparison operators" error:
<img width="877" alt="image" src="https://user-images.githubusercontent.com/33317356/204217342-879e94f9-e52b-4e67-b56a-1cf9b29a61c9.png">
### TESTING INSTRUCTIONS
1. Gnable "GENERIC_CHART_AXES` feature flag
2. Go to "Video Game Sales" dashboard and edit the "Most Dominant Platforms" chart
3. See an error
### ADDITIONAL INFORMATION
<!--- Check any relevant boxes with "x" -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] 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
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] codecov[bot] commented on pull request #22238: fix(generic-chart-axes): apply time filter on all target columns
Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on PR #22238:
URL: https://github.com/apache/superset/pull/22238#issuecomment-1328656361
# [Codecov](https://codecov.io/gh/apache/superset/pull/22238?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#22238](https://codecov.io/gh/apache/superset/pull/22238?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (2ddc3ae) into [master](https://codecov.io/gh/apache/superset/commit/22fab5e58ce574e962518067d982e3036449e580?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (22fab5e) will **decrease** coverage by `11.38%`.
> The diff coverage is `25.00%`.
```diff
@@ Coverage Diff @@
## master #22238 +/- ##
===========================================
- Coverage 66.85% 55.46% -11.39%
===========================================
Files 1841 1841
Lines 70197 70201 +4
Branches 7662 7662
===========================================
- Hits 46927 38940 -7987
- Misses 21296 29287 +7991
Partials 1974 1974
```
| Flag | Coverage Δ | |
|---|---|---|
| hive | `?` | |
| mysql | `?` | |
| postgres | `?` | |
| presto | `52.45% <25.00%> (-0.01%)` | :arrow_down: |
| python | `57.44% <25.00%> (-23.90%)` | :arrow_down: |
| sqlite | `?` | |
| unit | `50.87% <0.00%> (-0.01%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/superset/pull/22238?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [superset/connectors/sqla/models.py](https://codecov.io/gh/apache/superset/pull/22238/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29ubmVjdG9ycy9zcWxhL21vZGVscy5weQ==) | `74.75% <ø> (-14.58%)` | :arrow_down: |
| [superset/models/helpers.py](https://codecov.io/gh/apache/superset/pull/22238/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvbW9kZWxzL2hlbHBlcnMucHk=) | `34.92% <0.00%> (-3.35%)` | :arrow_down: |
| [superset/connectors/base/models.py](https://codecov.io/gh/apache/superset/pull/22238/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29ubmVjdG9ycy9iYXNlL21vZGVscy5weQ==) | `64.28% <50.00%> (-22.85%)` | :arrow_down: |
| [superset/utils/dashboard\_import\_export.py](https://codecov.io/gh/apache/superset/pull/22238/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvZGFzaGJvYXJkX2ltcG9ydF9leHBvcnQucHk=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [superset/tags/core.py](https://codecov.io/gh/apache/superset/pull/22238/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdGFncy9jb3JlLnB5) | `4.54% <0.00%> (-95.46%)` | :arrow_down: |
| [superset/key\_value/commands/update.py](https://codecov.io/gh/apache/superset/pull/22238/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL3VwZGF0ZS5weQ==) | `0.00% <0.00%> (-90.91%)` | :arrow_down: |
| [superset/key\_value/commands/delete.py](https://codecov.io/gh/apache/superset/pull/22238/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2RlbGV0ZS5weQ==) | `0.00% <0.00%> (-87.88%)` | :arrow_down: |
| [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/22238/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.19%)` | :arrow_down: |
| [superset/key\_value/commands/delete\_expired.py](https://codecov.io/gh/apache/superset/pull/22238/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQva2V5X3ZhbHVlL2NvbW1hbmRzL2RlbGV0ZV9leHBpcmVkLnB5) | `0.00% <0.00%> (-84.00%)` | :arrow_down: |
| [superset/dashboards/commands/importers/v0.py](https://codecov.io/gh/apache/superset/pull/22238/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9jb21tYW5kcy9pbXBvcnRlcnMvdjAucHk=) | `15.62% <0.00%> (-76.25%)` | :arrow_down: |
| ... and [285 more](https://codecov.io/gh/apache/superset/pull/22238/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] villebro merged pull request #22238: fix(generic-chart-axes): apply time filter on all target column types
Posted by GitBox <gi...@apache.org>.
villebro merged PR #22238:
URL: https://github.com/apache/superset/pull/22238
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] villebro commented on pull request #22238: fix(generic-chart-axes): apply time filter on all target column types
Posted by GitBox <gi...@apache.org>.
villebro commented on PR #22238:
URL: https://github.com/apache/superset/pull/22238#issuecomment-1328872103
> Thanks for the fixing! I would suggest that move the `filter_values_handler` method into a helper module and then refactoring it in the future. BTW, we should find out an approach to conversion column type.
My thoughts exactly - I have an idea of how to get this cleanup started, I'll try to open a PR later in the week.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org