Skip to content

Commit

Permalink
Remove default to pandas for groupby.ohlc() [upstream] (#5)
Browse files Browse the repository at this point in the history
* Remove default to pandas for groupby.ohlc()

Signed-off-by: Naren Krishna <naren@ponder.io>
  • Loading branch information
naren-ponder authored and vnlitvinov committed Mar 16, 2023
1 parent d8cf7ce commit 0742b70
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion modin/pandas/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,20 @@ def plot(self): # pragma: no cover
return self._default_to_pandas(lambda df: df.plot)

def ohlc(self):
return self._default_to_pandas(lambda df: df.ohlc())
from .dataframe import DataFrame
if isinstance(self._df, DataFrame):
raise NotImplementedError("groupby.ohlc() not supported for dataframes!")
else:
# Cannot use _wrap_aggregation() since assumed output is a Series
return DataFrame(
query_compiler=self._query_compiler.groupby_ohlc(
by=self._by,
axis=self._axis,
groupby_kwargs=self._kwargs,
agg_args=[],
agg_kwargs={},
),
)

def __bytes__(self):
"""
Expand Down

0 comments on commit 0742b70

Please sign in to comment.