codeant-ai-for-open-source[bot] commented on code in PR #45823:
URL: https://github.com/apache/superset/pull/45823#discussion_r4430893441
##########
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 `6b78fdb`.
The reshape now reorders the existing column levels with `reorder_levels`
and sorts them, rather than stacking and unstacking; this preserves only the
metric/category pairs already present.
<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 `6b78fdb`.
Non-numeric metric columns are converted with `to_numeric(errors="raise")`.
If conversion fails, the code raises `InvalidPostProcessingError` instead of
silently turning malformed values into 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]