mikebridge commented on code in PR #45126:
URL: https://github.com/apache/superset/pull/45126#discussion_r4235501732


##########
superset/semantic_layers/models.py:
##########
@@ -388,6 +389,20 @@ def get_query_result(self, query_object: QueryObject) -> 
QueryResult:
         security_manager.raise_for_unsupported_guest_rls(self)
         result: QueryResult = get_results(query_object)
         if query_object.post_processing and not result.df.empty:
+            # Nullable integer metrics arrive as exact Python ints; 
calculations
+            # need numbers, as for SQL datasets. Plain chart data stays exact.
+            metric_names: list[str] = query_object.metric_names
+            df_columns_to_num(
+                result.df,
+                {
+                    *metric_names,
+                    *(
+                        TIME_COMPARISON.join([metric, offset])
+                        for metric in metric_names
+                        for offset in query_object.time_offsets
+                    ),
+                },
+            )

Review Comment:
   Not reachable from the charts. Explicit contribution `columns` are always 
metric labels (table/ag-grid percent metrics, pie), and those are converted by 
`df_columns_to_num` above, including time-offset columns. Dividing a dimension 
is not a supported contribution, so dimensions stay exact on purpose.



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