You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/04/14 11:15:18 UTC

[GitHub] [superset] villebro commented on a diff in pull request #19716: fix: drop the first level of MultiIndex

villebro commented on code in PR #19716:
URL: https://github.com/apache/superset/pull/19716#discussion_r850339337


##########
superset/utils/pandas_postprocessing/flatten.py:
##########
@@ -25,12 +27,14 @@
 def flatten(
     df: pd.DataFrame,
     reset_index: bool = True,
+    drop_levels: Union[Tuple[int, ...], Tuple[str, ...]] = (),

Review Comment:
   nit: since I assume we'll be getting `List` (not `Tuple`) here due to the args coming from a JS object, and `Dataframe.droplevel` [works with list-like objects](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.droplevel.html#pandas.DataFrame.droplevel), maybe it would be more appropriate to use something like
   
   ```suggestion
       drop_levels: Optional[Union[Sequence[int, ...], Sequence[str, ...]]] = None,
   ```



-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org