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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
