Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Anatoly Myachev <[email protected]>
  • Loading branch information
anmyachev committed May 13, 2024
1 parent 778be02 commit 9d6d839
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
7 changes: 2 additions & 5 deletions modin/core/dataframe/base/dataframe/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import pandas
from pandas._typing import IndexLabel
from pandas.api.types import is_scalar
from pandas.core.dtypes.common import is_float_dtype, is_numeric_dtype
from pandas.core.dtypes.common import is_integer_dtype


class Axis(Enum): # noqa: PR01
Expand Down Expand Up @@ -170,10 +170,7 @@ def is_trivial_index(index: pandas.Index) -> bool:
return True
if isinstance(index, pandas.RangeIndex):
return index.start == 0 and index.step == 1
if not (
isinstance(index, pandas.Index)
and (is_numeric_dtype(index) and not is_float_dtype(index))
):
if not (isinstance(index, pandas.Index) and is_integer_dtype(index)):
return False
return (
index.is_monotonic_increasing
Expand Down
2 changes: 1 addition & 1 deletion modin/core/dataframe/pandas/metadata/dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ def _merge_dtypes(
# in the 'dtypes_matrix'
series = pandas.Series(dtypes, name=i)
dtypes_matrix = pandas.concat([dtypes_matrix, series], axis=1)
if val._know_all_names and val._remaining_dtype is None:
if not (val._know_all_names and val._remaining_dtype is None):
dtypes_matrix.fillna(
value={
# If we encountered a 'NaN' while 'val' describes all the columns, then
Expand Down
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 @@ -56,7 +56,7 @@ def corr_method(
min_periods: int = 1,
numeric_only: bool = True,
) -> PandasQueryCompiler:
if method != "pearson" or qc._modin_frame._pandas_backend == "pyarrow":
if method != "pearson" or qc.get_backend() == "pyarrow":
return super(type(qc), qc).corr(
method=method, min_periods=min_periods, numeric_only=numeric_only
)
Expand Down

0 comments on commit 9d6d839

Please sign in to comment.