AliIbnBotir commented on code in PR #45263:
URL: https://github.com/apache/superset/pull/45263#discussion_r4267616755


##########
superset/utils/pandas_postprocessing/flatten.py:
##########
@@ -101,5 +101,6 @@ def flatten(
         df.columns = _columns
 
     if reset_index and not isinstance(df.index, pd.RangeIndex):
-        df = df.reset_index(level=0)
+        # every level of a MultiIndex, e.g. a pivot with several index columns
+        df = df.reset_index()

Review Comment:
   Thanks. This collision isn’t new: the previous reset_index(level=0) already 
raises the same ValueError when level 0 shares a name with a column. This PR 
applies the same behaviour to every level instead of silently dropping levels 
1..n. Happy to add explicit handling if maintainers prefer, but it seems out of 
scope for this fix.



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