Skip to content

Commit

Permalink
Use inheritance and be explicit with types
Browse files Browse the repository at this point in the history
  • Loading branch information
mroeschke committed Jul 5, 2024
1 parent c444a64 commit 420294a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions python/cudf/cudf/core/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion python/cudf/cudf_pandas_tests/test_cudf_pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]})
Expand Down

0 comments on commit 420294a

Please sign in to comment.