From 420294a038ad5b9eed66a226cc477b287864e4ac Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Fri, 5 Jul 2024 15:44:15 -0700 Subject: [PATCH] Use inheritance and be explicit with types --- python/cudf/cudf/core/dataframe.py | 6 ++++-- python/cudf/cudf_pandas_tests/test_cudf_pandas.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/python/cudf/cudf/core/dataframe.py b/python/cudf/cudf/core/dataframe.py index f21979771b7..3e5ff9c18b5 100644 --- a/python/cudf/cudf/core/dataframe.py +++ b/python/cudf/cudf/core/dataframe.py @@ -462,7 +462,8 @@ def _setitem_tuple_arg(self, key, value): self._frame[col].loc[key[0]] = value[i] -_DataFrameAtIndexer = _DataFrameLocIndexer +class _DataFrameAtIndexer(_DataFrameLocIndexer): + pass class _DataFrameIlocIndexer(_DataFrameIndexer): @@ -587,7 +588,8 @@ def _setitem_tuple_arg(self, key, value): self._frame[col].iloc[key[0]] = value[i] -_DataFrameiAtIndexer = _DataFrameIlocIndexer +class _DataFrameiAtIndexer(_DataFrameIlocIndexer): + pass class DataFrame(IndexedFrame, Serializable, GetAttrGetItemMixin): diff --git a/python/cudf/cudf_pandas_tests/test_cudf_pandas.py b/python/cudf/cudf_pandas_tests/test_cudf_pandas.py index 7ca00f9f004..b0aeaba3916 100644 --- a/python/cudf/cudf_pandas_tests/test_cudf_pandas.py +++ b/python/cudf/cudf_pandas_tests/test_cudf_pandas.py @@ -1580,7 +1580,7 @@ def test_at_iat(indexer): def test_at_setitem_empty(): - df = xpd.DataFrame({"name": []}) + df = xpd.DataFrame({"name": []}, dtype="float64") df.at[0, "name"] = 1.0 df.at[0, "new"] = 2.0 expected = pd.DataFrame({"name": [1.0], "new": [2.0]})