Skip to content

Commit

Permalink
Fix dataframe.dtype AttributeError
Browse files Browse the repository at this point in the history
  • Loading branch information
martinfalisse committed Apr 12, 2022
1 parent 84f096c commit 1509af5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions python/cudf/cudf/core/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -5146,9 +5146,7 @@ def _reduce(
for col in source._data.names
]
except AttributeError:
raise TypeError(
f"cannot perform {op} with type {source.dtype}"
)
raise TypeError(f"Not all column dtypes support op {op}")

return Series._from_data(
{None: result}, as_index(source._data.names)
Expand Down
4 changes: 2 additions & 2 deletions python/cudf/cudf/tests/test_dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -9172,7 +9172,7 @@ def test_mean_timeseries():

assert_eq(expected, actual)

with pytest.raises(AttributeError):
with pytest.raises(TypeError):
gdf.mean()


Expand All @@ -9195,5 +9195,5 @@ def test_std_different_dtypes(data):

assert_eq(expected, actual)

with pytest.raises(AttributeError):
with pytest.raises(TypeError):
gdf.std()

0 comments on commit 1509af5

Please sign in to comment.