Skip to content

Commit

Permalink
FEAT-#2375: removed unused code
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Chigarev <[email protected]>
  • Loading branch information
dchigarev committed Dec 8, 2020
1 parent 047ec19 commit 7474170
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions modin/backends/pandas/query_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2565,20 +2565,17 @@ def groupby_agg_builder(df, by=None, drop=False, partition_idx=None):
missmatched_cols = pandas.Index([])
if by is not None:
internal_by_df = by[internal_by]

if isinstance(internal_by_df, pandas.Series):
internal_by_df = internal_by_df.to_frame()

if isinstance(internal_by_df, pandas.DataFrame):
missmatched_cols = internal_by_df.columns.difference(df.columns)
df = pandas.concat(
[df, internal_by_df[missmatched_cols]],
axis=1,
)
internal_by_cols = internal_by_df.columns
elif is_multi_by:
internal_by_cols = pandas.Index([internal_by_df.name])
else:
internal_by_cols = pandas.Index([internal_by_df])
missmatched_cols = internal_by_df.columns.difference(df.columns)
df = pandas.concat(
[df, internal_by_df[missmatched_cols]],
axis=1,
copy=False,
)
internal_by_cols = internal_by_df.columns

external_by = by.columns.difference(internal_by)
external_by_df = by[external_by].squeeze(axis=1)
Expand Down

0 comments on commit 7474170

Please sign in to comment.