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


##########
superset/charts/client_processing.py:
##########
@@ -1417,18 +1417,27 @@ def _is_default_index_column(series: pd.Series) -> bool:
 def _read_excel_for_client_processing(
     data: bytes,
     form_data: dict[str, Any],
+    verbose_map: Optional[dict[str, str]] = None,
 ) -> pd.DataFrame:
     df = pd.read_excel(BytesIO(data))
     if len(df.columns) == 0:
         return df
 
     first_column = df.columns[0]
-    expected_columns = {
+    expected_columns: set[str] = {
         *get_column_names(form_data.get("columns")),
+        *get_column_names(form_data.get("all_columns")),
+        *get_column_names(form_data.get("groupby")),
         *get_column_names(form_data.get("groupbyRows")),
         *get_column_names(form_data.get("groupbyColumns")),
         *get_metric_names(form_data.get("metrics")),
+        *(f"%{name}" for name in 
get_metric_names(form_data.get("percent_metrics"))),
     }
+    # Query exports can already carry display labels rather than selection 
names.
+    if verbose_map:
+        expected_columns |= {
+            verbose_map.get(column, column) for column in expected_columns
+        }

Review Comment:
   Good catch — reproduced for XLSX and CSV. Fixed in 
66bc43fbb90d2a4b9a976fd09008974cdba5d550: serialized exports already have 
display labels, so only JSON needs the rename here. Added a producer-to-export 
regression for both formats; 493 chart tests pass.



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