Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
galipremsagar committed Mar 22, 2023
1 parent f81c1b3 commit 4bf1b91
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
11 changes: 5 additions & 6 deletions python/cudf/cudf/tests/test_concat.py
Original file line number Diff line number Diff line change
Expand Up @@ -1872,14 +1872,13 @@ def test_concat_invalid_axis(axis):


@pytest.mark.parametrize(
"s1,s2,expected",
"s1,s2",
[
([1, 2], [[1, 2], [3, 4]], ["1", "2", "[1, 2]", "[3, 4]"]),
([1, 2], [[1, 2], [3, 4]]),
],
)
def test_concat_mixed_list_types(s1, s2, expected):
def test_concat_mixed_list_types_error(s1, s2):
s1, s2 = gd.Series(s1), gd.Series(s2)
expected = pd.Series(expected)
actual = gd.concat([s1, s2], ignore_index=True)

assert_eq(expected, actual, check_dtype=False)
with pytest.raises(NotImplementedError):
gd.concat([s1, s2], ignore_index=True)
3 changes: 2 additions & 1 deletion python/cudf/cudf/tests/test_dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -10030,6 +10030,7 @@ def test_dataframe_transpose_complex_types(data):

assert_eq(expected, actual)


@pytest.mark.parametrize(
"data",
[
Expand All @@ -10043,6 +10044,7 @@ def test_dataframe_values_complex_types(data):
with pytest.raises(NotImplementedError):
gdf.values


def test_dataframe_from_arrow_slice():
table = pa.Table.from_pandas(
pd.DataFrame.from_dict(
Expand All @@ -10055,4 +10057,3 @@ def test_dataframe_from_arrow_slice():
actual = cudf.DataFrame.from_arrow(table_slice)

assert_eq(expected, actual)

5 changes: 4 additions & 1 deletion python/cudf/cudf/utils/dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,10 @@ def find_common_type(dtypes):
# common dtype, for example:
# ListDtype(int64) & ListDtype(int32) common
# dtype could be ListDtype(int64).
return cudf.dtype("O")
raise NotImplementedError(
"Finding a common type for `ListDtype` is currently "
"not supported"
)
if any(cudf.api.types.is_struct_dtype(dtype) for dtype in dtypes):
if len(dtypes) == 1:
return dtypes.get(0)
Expand Down

0 comments on commit 4bf1b91

Please sign in to comment.