codeant-ai-for-open-source[bot] commented on code in PR #45823:
URL: https://github.com/apache/superset/pull/45823#discussion_r4409660286


##########
superset/utils/pandas_postprocessing/pivot.py:
##########
@@ -404,8 +404,6 @@ def pivot(  # pylint: disable=too-many-arguments  # noqa: 
C901
         df = _apply_show_values_as(df, percent_mode)
 
     if combine_value_with_metric:
-        # dropna=False preserves restored all-NaN metric rows that would 
otherwise
-        # be silently dropped by stack's default dropna=True behavior.
-        df = df.stack(level=0, dropna=False).unstack()
+        df = df.stack(level=0, future_stack=True).unstack()

Review Comment:
   ✅ **CodeAnt verified this suggestion was addressed in subsequent commits and 
marked this thread resolved** as of `8b34fed`.
   
   The column reshape now uses `reorder_levels` and `sort_index` instead of 
stacking and unstacking, preserving only the observed metric/category pairs.
   
   <sub>If that's not right, unresolve this thread and CodeAnt will leave it 
open.</sub>
   
   <!-- codeant-auto-resolve-reply -->



##########
superset/utils/pandas_postprocessing/boxplot.py:
##########
@@ -135,7 +135,7 @@ def outliers(series: Series) -> set[float]:
     # nanpercentile needs numeric values, otherwise the isnan function
     # that's used in the underlying function will fail
     for column in metrics:
-        if is_object_dtype(df[column]):
-            df.loc[:, column] = to_numeric(df[column], errors="coerce")
+        if is_object_dtype(df[column]) or is_string_dtype(df[column]):
+            df[column] = to_numeric(df[column], errors="coerce")

Review Comment:
   ✅ **CodeAnt verified this suggestion was addressed in subsequent commits and 
marked this thread resolved** as of `8b34fed`.
   
   Object and string metric columns are converted with 
`to_numeric(errors="raise")`; malformed values now raise 
`InvalidPostProcessingError` instead of becoming NaN.
   
   <sub>If that's not right, unresolve this thread and CodeAnt will leave it 
open.</sub>
   
   <!-- codeant-auto-resolve-reply -->



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