This is an automated email from the ASF dual-hosted git repository.
beto pushed a commit to branch sc-69810
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/sc-69810 by this push:
new 342bc26482 Improve comment
342bc26482 is described below
commit 342bc26482f587d4187dbf78b2521362e3d11e6f
Author: Beto Dealmeida <[email protected]>
AuthorDate: Thu Nov 30 10:23:51 2023 -0500
Improve comment
---
superset-frontend/src/components/Chart/chartAction.js | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/superset-frontend/src/components/Chart/chartAction.js
b/superset-frontend/src/components/Chart/chartAction.js
index bdf4fe8ac7..5ac9ac061f 100644
--- a/superset-frontend/src/components/Chart/chartAction.js
+++ b/superset-frontend/src/components/Chart/chartAction.js
@@ -269,10 +269,9 @@ export function runAnnotationQuery({
return Promise.resolve();
}
- // remap from controls to formData naming; in the original formData the
- // `granularity` attribute represents the time grain, but in the request
- // payload it corresponds to the name of the column where the time grain
- // should be applied...
+ // In the original formData the `granularity` attribute represents the
time grain (eg
+ // `P1D`), but in the request payload it corresponds to the name of the
column where
+ // the time grain should be applied (eg, `Date`), so we need to move
things around.
fd.time_grain_sqla = fd.time_grain_sqla || fd.granularity;
fd.granularity = fd.granularity_sqla;