Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Anatoly Myachev <[email protected]>
  • Loading branch information
anmyachev committed May 7, 2024
1 parent 068f67d commit 45c1d1f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
5 changes: 3 additions & 2 deletions modin/core/dataframe/pandas/dataframe/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -1681,7 +1681,7 @@ def astype(self, col_dtypes, errors: str = "raise"):
if new_dtypes is None:
new_dtypes = self_dtypes.copy()
# Update the new dtype series to the proper pandas dtype
# TODO: pyarrow backend? We don't need to add an implicit backend for `astype`
# We don't need to add an implicit backend for `astype`
new_dtype = pandas.api.types.pandas_dtype(dtype)
if Engine.get() == "Dask" and hasattr(dtype, "_is_materialized"):
# FIXME: https://github.com/dask/distributed/issues/8585
Expand Down Expand Up @@ -1711,7 +1711,8 @@ def astype_builder(df):
# Assume that the dtype is a scalar.
if not (col_dtypes == self_dtypes).all():
new_dtypes = self_dtypes.copy()
new_dtype = self.construct_dtype(col_dtypes, self._pandas_backend)
# We don't need to add an implicit backend for `astype`
new_dtype = pandas.api.types.pandas_dtype(col_dtypes)
if Engine.get() == "Dask" and hasattr(new_dtype, "_is_materialized"):
# FIXME: https://github.com/dask/distributed/issues/8585
_ = new_dtype._materialize_categories()
Expand Down
10 changes: 7 additions & 3 deletions modin/tests/pandas/dataframe/test_map_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -1429,6 +1429,9 @@ def comparator(df1, df2):
elif idx == 2:
# FIXME: https://github.com/modin-project/modin/issues/7080
expected_exception = False

if any("pyarrow" in str(dtype) for dtype in pandas_df.dtypes):
pytest.xfail(reason="ValueError(2)")
eval_insert(
modin_df,
pandas_df,
Expand Down Expand Up @@ -1683,12 +1686,13 @@ def test___neg__(request, data):
@pytest.mark.parametrize("data", test_data_values, ids=test_data_keys)
def test___invert__(data, request):
expected_exception = None
md_df, pd_df = create_test_dfs(data)
if "float_nan_data" in request.node.callspec.id:
# FIXME: https://github.com/modin-project/modin/issues/7081
expected_exception = False
eval_general(
*create_test_dfs(data), lambda df: ~df, expected_exception=expected_exception
)
if any("pyarrow" in str(dtype) for dtype in pd_df.dtypes):
pytest.xfail(reason="pyarrow.lib.ArrowNotImplementedError")
eval_general(md_df, pd_df, lambda df: ~df, expected_exception=expected_exception)


def test___invert___bool():
Expand Down

0 comments on commit 45c1d1f

Please sign in to comment.