fix: implement extra filter logic#688
Conversation
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/superset/superset-ui/h4r3c3xon |
Codecov Report
@@ Coverage Diff @@
## master #688 +/- ##
==========================================
+ Coverage 24.04% 24.20% +0.15%
==========================================
Files 338 338
Lines 7590 7607 +17
Branches 918 924 +6
==========================================
+ Hits 1825 1841 +16
Misses 5692 5692
- Partials 73 74 +1
Continue to review full report at Codecov.
|
| // map to undeprecated names and remove deprecated fields | ||
| if (isDruidFormData(formData) && !partialQueryObject.druid_time_origin) { | ||
| partialQueryObject.extras = { | ||
| druid_time_origin: formData.druid_time_origin, |
There was a problem hiding this comment.
druid_time_origin is optional on the data type checked by isDruidFormData. Should a default be specified here, e.g. druid_time_origin: formData.druid_time_origin || someDefault,?
There was a problem hiding this comment.
The backend expects most of these to be undefined if they haven't been given an explicit value (time_grain, druid_time_origin etc). So these should be safe to leave as is.
rusackas
left a comment
There was a problem hiding this comment.
LGTM, but want to make sure that extractExtras.ts handles undefined parameters and/or provides default values wherever needed, just to be safe.
* fix: implement extra filter logic * fix bugs and add tests * remove redundant changes * improve types * fix coverage * improve codevov
🐛 Bug Fix
This implements the
merge_extra_filtersfunction + applicable features other legacy Python code inutils/core.pyto fix these TODOs:This removes all deprecated
QueryObjectfields (for instance, replacingQueryObject.granularity_sqlawithgranularityandQueryObject.havingtoQueryObject.extras.havingetc) and makes extra filters work properly.