JCelento opened a new pull request, #36985: URL: https://github.com/apache/superset/pull/36985
<!--- Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/ Example: fix(dashboard): load charts correctly --> ### SUMMARY Bug: When using a Time Column native filter on a dashboard using legacy charts like Country Map, the user column selection was being ignored and it was always filtering using the dataset default temporal column. Root Cause: The issue was in the backend's merge_extra_form_data function, which was receiving the user selected column but was not updating the subject in the TEMPORAL_RANGE adhoc filter. Fix: Change the merge_extra_form_data fuction to update the adhoc filter's subject of TEMPORAL_RANGE when granularity_sqla is provided via extra_form_data. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF BEFORE:  AFTER:  ### TESTING INSTRUCTIONS #### 1. Create and load the test table (or any table with multiple temporal columns), e.g. country_map_us_states_test with: - iso_3166_2_code (e.g. US-CA, US-TX) - metric_value (numeric) - Three temporal columns: -- event_date (DATE) -- created_at (TIMESTAMP) -- updated_at (TIMESTAMP) #### 2. Create a dataset from country_map_us_states_test and mark all three temporal columns (event_date, created_at, updated_at) as temporal. #### 3. Create a new chart using: - Chart type: Country Map - Country: United States - ISO 3166-2 Codes: iso_3166_2_code - Metric: SUM(metric_value) #### 4. Save the chart. #### 5. Add this Country Map chart to a dashboard. #### 6. Add a native filter of type Time Column to the dashboard. In the filter configuration: - Choose Time Column = created_at (or any non-default temporal column). - Set a time range, e.g. 2024-01-01 → 2024-03-01. - Apply the filter and open … → View query on the Country Map chart. #### Expected results The time range filter is applied over the column that the “Time Column” filter says. ### 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]
