zhaoyongjie commented on PR #20728:
URL: https://github.com/apache/superset/pull/20728#issuecomment-1211554410

   I made a new 
[Dashboard](http://35.92.54.239:8080/superset/dashboard/11/?native_filters_key=-bblsJtUTdJayrXOD2hqXBr8HSYTeFNuCbEMxPaXpJ_qlenMFnhUv4gLseAWOO7-)
 on the ephemeral environment.
   
   The time filter on the drill payload looks incorrect because the `time 
filter` is different from other filters in the current filter design. Ideally, 
these things should be applied under the filters field, but this part still 
needs a lot of work. 
   
   The drill-detail payload has such fields.
   ```
   {
     extras: { time_grain_sqla }  <---- how to aggregate time column, for 
example: P1Y('2022-03-01') => '2022-01-01'
     granularity <----- used for time column
     time_range <----- used for time value, it's a pairs value, like the 
`between` value in SQL
   }
   ```
   
   Fortunately, the `time_range` field supports lots of `time expression`. The 
`time value(timestamp represented by integer)` and `time_grain_sqla` should be 
converted to `time expression`. For example, the time value is `1643673600000` 
and time_grain_sqla is `P1Y`. 
   1. convert the time value from the integer to the time string,
   2. apply time expression into time string and get a `time_range` value
   
   ```
   datetrunc(datetime('2022-02-01'), year) : lastday(datetime('2019-02-01'), 
year)
   ```
   
   
   
   
https://user-images.githubusercontent.com/2016594/184063120-78ea29a1-5f5d-40f7-a81c-d6260313fb79.mov
   
   
   


-- 
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]

Reply via email to