apache / superset

Apache Superset is a Data Visualization and Data Exploration Platform
https://superset.apache.org/
Apache License 2.0
61.99k stars 13.59k forks source link

fix(table): Use extras in queries #30335

Closed Antonio-RiveroMartnez closed 1 week ago

Antonio-RiveroMartnez commented 1 week ago

SUMMARY

Table chart was removing the extras from the summary query, assuming they were only used for time grains. This PR fixes that and put the extras back in the queryObject sent as payload, now, only excluding time_grain_sqla if no temporal column is included in your chart.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before: Excluding extras from summary query and only adding it if no time comparison was used

before

Now: Sending extras in the total query regardless you're using time comparison No temporal Column

now_no_temp

With temporal Column

now_temp

TESTING INSTRUCTIONS

  1. Create a Table Chart
  2. Use no temporal column and a custom SQL filter
  3. Mark the Show summary checkbox
  4. The queries sent as payload must include the where in extras for both queries and not include a time_grain_sqla
  5. Now add a temporal column to your chart and run the query again
  6. The time_grain_sqla must be present in the extras alongside with the where clause

ADDITIONAL INFORMATION