Skip to content

Commit

Permalink
FEAT-#7203: Make sure Modin works correctly with pandas, which uses p…
Browse files Browse the repository at this point in the history
…yarrow as a backend (#7204)

Signed-off-by: Anatoly Myachev <anatoly.myachev@intel.com>
Co-authored-by: Iaroslav Igoshev <Poolliver868@mail.ru>
  • Loading branch information
anmyachev and YarShev committed May 14, 2024
1 parent f81bbe6 commit aa6e5c2
Show file tree
Hide file tree
Showing 23 changed files with 359 additions and 142 deletions.
2 changes: 0 additions & 2 deletions modin/core/dataframe/algebra/binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,6 @@ def try_compute_new_dtypes(

try:
if infer_dtypes == "bool" or is_bool_dtype(result_dtype):
# FIXME: https://github.com/modin-project/modin/issues/7203
# can be `pandas.api.types.pandas_dtype("bool[pyarrow]")` depending on the data
dtypes = maybe_build_dtypes_series(
first, second, dtype=pandas.api.types.pandas_dtype(bool)
)
Expand Down
4 changes: 2 additions & 2 deletions modin/core/dataframe/base/dataframe/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
from enum import Enum
from typing import Dict, List, Sequence, Tuple, cast

import numpy as np
import pandas
from pandas._typing import IndexLabel
from pandas.api.types import is_scalar
from pandas.core.dtypes.common import is_integer_dtype


class Axis(Enum): # noqa: PR01
Expand Down Expand Up @@ -170,7 +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 index.dtype == np.int64):
if not (isinstance(index, pandas.Index) and is_integer_dtype(index)):
return False
return (
index.is_monotonic_increasing
Expand Down

0 comments on commit aa6e5c2

Please sign in to comment.