diff --git a/conda/environments/cudf_dev_cuda10.1.yml b/conda/environments/cudf_dev_cuda10.1.yml index 92cb84a9c0b..26d6067b768 100644 --- a/conda/environments/cudf_dev_cuda10.1.yml +++ b/conda/environments/cudf_dev_cuda10.1.yml @@ -17,7 +17,7 @@ dependencies: - python>=3.7,<3.9 - numba>=0.49.0,!=0.51.0 - numpy - - pandas>=1.0,<1.3.0dev0 + - pandas>=1.0,<=1.2.4 - pyarrow=1.0.1 - fastavro>=0.22.9 - notebook>=0.5.0 diff --git a/conda/environments/cudf_dev_cuda10.2.yml b/conda/environments/cudf_dev_cuda10.2.yml index 63fa307d324..da7e4a91106 100644 --- a/conda/environments/cudf_dev_cuda10.2.yml +++ b/conda/environments/cudf_dev_cuda10.2.yml @@ -17,7 +17,7 @@ dependencies: - python>=3.7,<3.9 - numba>=0.49,!=0.51.0 - numpy - - pandas>=1.0,<1.3.0dev0 + - pandas>=1.0,<=1.2.4 - pyarrow=1.0.1 - fastavro>=0.22.9 - notebook>=0.5.0 diff --git a/conda/environments/cudf_dev_cuda11.0.yml b/conda/environments/cudf_dev_cuda11.0.yml index 2dce24bda62..b3aab1da1e5 100644 --- a/conda/environments/cudf_dev_cuda11.0.yml +++ b/conda/environments/cudf_dev_cuda11.0.yml @@ -17,7 +17,7 @@ dependencies: - python>=3.7,<3.9 - numba>=0.49,!=0.51.0 - numpy - - pandas>=1.0,<1.3.0dev0 + - pandas>=1.0,<=1.2.4 - pyarrow=1.0.1 - fastavro>=0.22.9 - notebook>=0.5.0 diff --git a/conda/environments/cudf_dev_cuda11.1.yml b/conda/environments/cudf_dev_cuda11.1.yml index 1e7e7e9c127..7feadb5de82 100644 --- a/conda/environments/cudf_dev_cuda11.1.yml +++ b/conda/environments/cudf_dev_cuda11.1.yml @@ -17,7 +17,7 @@ dependencies: - python>=3.7,<3.9 - numba>=0.49,!=0.51.0 - numpy - - pandas>=1.0,<1.3.0dev0 + - pandas>=1.0,<=1.2.4 - pyarrow=1.0.1 - fastavro>=0.22.9 - notebook>=0.5.0 diff --git a/conda/environments/cudf_dev_cuda11.2.yml b/conda/environments/cudf_dev_cuda11.2.yml index 09a07df6e31..10ae1931d3c 100644 --- a/conda/environments/cudf_dev_cuda11.2.yml +++ b/conda/environments/cudf_dev_cuda11.2.yml @@ -17,7 +17,7 @@ dependencies: - python>=3.7,<3.9 - numba>=0.49,!=0.51.0 - numpy - - pandas>=1.0,<1.3.0dev0 + - pandas>=1.0,<=1.2.4 - pyarrow=1.0.1 - fastavro>=0.22.9 - notebook>=0.5.0 diff --git a/conda/recipes/cudf/meta.yaml b/conda/recipes/cudf/meta.yaml index 5635f54ba20..c9d2ee06d58 100644 --- a/conda/recipes/cudf/meta.yaml +++ b/conda/recipes/cudf/meta.yaml @@ -35,7 +35,7 @@ requirements: - protobuf - python - typing_extensions - - pandas >=1.0,<1.3.0dev0 + - pandas >=1.0,<=1.2.4 - cupy >7.1.0,<9.0.0a0 - numba >=0.49.0 - numpy diff --git a/python/cudf/cudf/core/_compat.py b/python/cudf/cudf/core/_compat.py index 807e96f2c38..24b25b6eec0 100644 --- a/python/cudf/cudf/core/_compat.py +++ b/python/cudf/cudf/core/_compat.py @@ -7,4 +7,4 @@ PANDAS_GE_100 = PANDAS_VERSION >= version.parse("1.0") PANDAS_GE_110 = PANDAS_VERSION >= version.parse("1.1") PANDAS_GE_120 = PANDAS_VERSION >= version.parse("1.2") -PANDAS_EQ_123 = PANDAS_VERSION == version.parse("1.2.3") +PANDAS_LE_122 = PANDAS_VERSION <= version.parse("1.2.2") diff --git a/python/cudf/cudf/core/dataframe.py b/python/cudf/cudf/core/dataframe.py index 6639fc7c25c..48c1f49e6ea 100644 --- a/python/cudf/cudf/core/dataframe.py +++ b/python/cudf/cudf/core/dataframe.py @@ -7931,7 +7931,12 @@ def _align_indices(lhs, rhs): return lhs_out, rhs_out -def _setitem_with_dataframe(input_df, replace_df, input_cols=None, mask=None): +def _setitem_with_dataframe( + input_df: DataFrame, + replace_df: DataFrame, + input_cols: Any = None, + mask: Optional[cudf.core.column.ColumnBase] = None, +): """ This function sets item dataframes relevant columns with replacement df :param input_df: Dataframe to be modified inplace @@ -7948,6 +7953,9 @@ def _setitem_with_dataframe(input_df, replace_df, input_cols=None, mask=None): "Number of Input Columns must be same replacement Dataframe" ) + if not input_df.index.equals(replace_df.index): + replace_df = replace_df.reindex(input_df.index) + for col_1, col_2 in zip(input_cols, replace_df.columns): if col_1 in input_df.columns: if mask is not None: diff --git a/python/cudf/cudf/tests/test_setitem.py b/python/cudf/cudf/tests/test_setitem.py index 1005efec3ee..28cb2568908 100644 --- a/python/cudf/cudf/tests/test_setitem.py +++ b/python/cudf/cudf/tests/test_setitem.py @@ -5,7 +5,7 @@ import pytest import cudf -from cudf.core._compat import PANDAS_EQ_123, PANDAS_GE_120 +from cudf.core._compat import PANDAS_GE_120, PANDAS_LE_122 from cudf.tests.utils import assert_eq, assert_exceptions_equal @@ -21,7 +21,7 @@ def test_dataframe_setitem_bool_mask_scaler(df, arg, value): @pytest.mark.xfail( - condition=PANDAS_EQ_123 or not PANDAS_GE_120, + condition=PANDAS_GE_120 and PANDAS_LE_122, reason="https://github.com/pandas-dev/pandas/issues/40204", ) def test_dataframe_setitem_scaler_bool(): diff --git a/python/cudf/requirements/cuda-10.1/dev_requirements.txt b/python/cudf/requirements/cuda-10.1/dev_requirements.txt index 967974d38b5..bb35cb47330 100644 --- a/python/cudf/requirements/cuda-10.1/dev_requirements.txt +++ b/python/cudf/requirements/cuda-10.1/dev_requirements.txt @@ -21,7 +21,7 @@ numpy numpydoc nvtx>=0.2.1 packaging -pandas>=1.0,<1.3.0dev0 +pandas>=1.0,<=1.2.4 pandoc==2.0a4 protobuf pyorc diff --git a/python/cudf/requirements/cuda-10.2/dev_requirements.txt b/python/cudf/requirements/cuda-10.2/dev_requirements.txt index 34450456b5a..90bb1b4dd22 100644 --- a/python/cudf/requirements/cuda-10.2/dev_requirements.txt +++ b/python/cudf/requirements/cuda-10.2/dev_requirements.txt @@ -21,7 +21,7 @@ numpy numpydoc nvtx>=0.2.1 packaging -pandas>=1.0,<1.3.0dev0 +pandas>=1.0,<=1.2.4 pandoc==2.0a4 protobuf pyorc diff --git a/python/cudf/requirements/cuda-11.0/dev_requirements.txt b/python/cudf/requirements/cuda-11.0/dev_requirements.txt index 278b1a6bf61..db9a19537d2 100644 --- a/python/cudf/requirements/cuda-11.0/dev_requirements.txt +++ b/python/cudf/requirements/cuda-11.0/dev_requirements.txt @@ -21,7 +21,7 @@ numpy numpydoc nvtx>=0.2.1 packaging -pandas>=1.0,<1.3.0dev0 +pandas>=1.0,<=1.2.4 pandoc==2.0a4 protobuf pyorc diff --git a/python/cudf/requirements/cuda-11.1/dev_requirements.txt b/python/cudf/requirements/cuda-11.1/dev_requirements.txt index fafdc7d7d4f..488d0daabd7 100644 --- a/python/cudf/requirements/cuda-11.1/dev_requirements.txt +++ b/python/cudf/requirements/cuda-11.1/dev_requirements.txt @@ -21,7 +21,7 @@ numpy numpydoc nvtx>=0.2.1 packaging -pandas>=1.0,<1.3.0dev0 +pandas>=1.0,<=1.2.4 pandoc==2.0a4 protobuf pyorc diff --git a/python/cudf/requirements/cuda-11.2/dev_requirements.txt b/python/cudf/requirements/cuda-11.2/dev_requirements.txt index db434b7c8ec..33875e01c58 100644 --- a/python/cudf/requirements/cuda-11.2/dev_requirements.txt +++ b/python/cudf/requirements/cuda-11.2/dev_requirements.txt @@ -21,7 +21,7 @@ numpy numpydoc nvtx>=0.2.1 packaging -pandas>=1.0,<1.3.0dev0 +pandas>=1.0,<=1.2.4 pandoc==2.0a4 protobuf pyorc diff --git a/python/cudf/setup.py b/python/cudf/setup.py index 5d95516c0dd..67a2238eeca 100644 --- a/python/cudf/setup.py +++ b/python/cudf/setup.py @@ -24,7 +24,7 @@ "fastavro>=0.22.9", "fsspec>=0.6.0", "numpy", - "pandas>=1.0,<1.3.0dev0", + "pandas>=1.0,<=1.2.4", "typing_extensions", "protobuf", "nvtx>=0.2.1", diff --git a/python/dask_cudf/dev_requirements.txt b/python/dask_cudf/dev_requirements.txt index c157c0be86f..f98d2c50c99 100644 --- a/python/dask_cudf/dev_requirements.txt +++ b/python/dask_cudf/dev_requirements.txt @@ -5,7 +5,7 @@ distributed>=2.22.0,<=2021.4.0 fsspec>=0.6.0 numba>=0.49.0,!=0.51.0 numpy -pandas>=1.0,<1.3.0dev0 +pandas>=1.0,<=1.2.4 pytest setuptools wheel diff --git a/python/dask_cudf/setup.py b/python/dask_cudf/setup.py index f735d895095..9e2224338cc 100644 --- a/python/dask_cudf/setup.py +++ b/python/dask_cudf/setup.py @@ -14,13 +14,13 @@ "distributed>=2.22.0,<=2021.4.0", "fsspec>=0.6.0", "numpy", - "pandas>=1.0,<1.3.0dev0", + "pandas>=1.0,<=1.2.4", ] extras_require = { "test": [ "numpy", - "pandas>=1.0,<1.3.0dev0", + "pandas>=1.0,<=1.2.4", "pytest", "numba>=0.49.0,!=0.51.0", "dask==2021.4.0",