Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Anatoly Myachev <[email protected]>
  • Loading branch information
anmyachev committed May 14, 2024
1 parent 30d4749 commit 353f603
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion modin/core/storage_formats/pandas/aggregations.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def corr_method(
numeric_only: bool = True,
) -> PandasQueryCompiler:
# Further implementation is designed for the default pandas backend (numpy)
if method != "pearson" or qc.get_backend() == "pyarrow":
if method != "pearson" or qc.get_pandas_backend() == "pyarrow":

Check warning on line 60 in modin/core/storage_formats/pandas/aggregations.py

View check run for this annotation

Codecov / codecov/patch

modin/core/storage_formats/pandas/aggregations.py#L60

Added line #L60 was not covered by tests
return super(type(qc), qc).corr(
method=method, min_periods=min_periods, numeric_only=numeric_only
)
Expand Down
2 changes: 1 addition & 1 deletion modin/core/storage_formats/pandas/query_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2284,7 +2284,7 @@ def clip(self, lower, upper, **kwargs):
corr = CorrCovBuilder.build_corr_method()

def cov(self, min_periods=None, ddof=1):
if self.get_backend() == "pyarrow":
if self.get_pandas_backend() == "pyarrow":
return super().cov(min_periods=min_periods, ddof=ddof)

Check warning on line 2288 in modin/core/storage_formats/pandas/query_compiler.py

View check run for this annotation

Codecov / codecov/patch

modin/core/storage_formats/pandas/query_compiler.py#L2287-L2288

Added lines #L2287 - L2288 were not covered by tests
# _nancorr use numpy which incompatible with pandas dataframes on pyarrow
return self._nancorr(min_periods=min_periods, cov=True, ddof=ddof)
Expand Down
8 changes: 4 additions & 4 deletions modin/pandas/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -1622,8 +1622,8 @@ def prod(
skipna is not False
and numeric_only is False
and min_count > len(axis_to_apply)
# Type inference is not so simple for pyarrow
and self._query_compiler.get_backend() is None
# This fast path is only suitable for the default backend
and self._query_compiler.get_pandas_backend() is None
):
new_index = self.columns if not axis else self.index
# >>> pd.DataFrame([1,2,3,4], dtype="int64[pyarrow]").prod(min_count=10)
Expand Down Expand Up @@ -2152,8 +2152,8 @@ def sum(
skipna is not False
and numeric_only is False
and min_count > len(axis_to_apply)
# Type inference is not so simple for pyarrow
and self._query_compiler.get_backend() is None
# This fast path is only suitable for the default backend
and self._query_compiler.get_pandas_backend() is None
):
new_index = self.columns if not axis else self.index
return Series(
Expand Down

0 comments on commit 353f603

Please sign in to comment.