graceguo-supercat commented on a change in pull request #6286: [annotation] 
Only allow override whole time_range
URL: 
https://github.com/apache/incubator-superset/pull/6286#discussion_r231353601
 
 

 ##########
 File path: superset/assets/src/chart/chartAction.js
 ##########
 @@ -77,10 +77,13 @@ export function runAnnotationQuery(annotation, timeout = 
60, formData = null, ke
     const granularity = fd.time_grain_sqla || fd.granularity;
     fd.time_grain_sqla = granularity;
     fd.granularity = granularity;
-    if (fd.time_range) {
-      [fd.since, fd.until] = fd.time_range.split(TIME_RANGE_SEPARATOR);
+    const overridesKeys = Object.keys(annotation.overrides);
+    if (overridesKeys.includes('since') || overridesKeys.includes('until')) {
 
 Review comment:
   this line is to backward compatible with old override options: since or 
until. now we only allow override whole time_range, so either since or until 
will be treated as override whole time_range.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to