Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions python/cudf/cudf/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,18 @@ def deserialize(cls, header, frames):
)
return cls._from_data(col_accessor)

@_performance_tracking
def nans_to_nulls(self):
result = []
for col in self._columns:
converted = col.nans_to_nulls()
if converted is col:
converted = converted.copy()
result.append(converted)
return self._from_data_like_self(
self._data._from_columns_like_self(result)
)

@classmethod
@_performance_tracking
def _from_data(cls, data: MutableMapping) -> Self:
Expand Down
10 changes: 1 addition & 9 deletions python/cudf/cudf/core/indexed_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -1935,15 +1935,7 @@ def nans_to_nulls(self):
1 <NA> 3.14
2 <NA> <NA>
"""
result = []
for col in self._columns:
converted = col.nans_to_nulls()
if converted is col:
converted = converted.copy()
result.append(converted)
return self._from_data_like_self(
self._data._from_columns_like_self(result)
)
return super().nans_to_nulls()

@_performance_tracking
def interpolate(
Expand Down
1 change: 0 additions & 1 deletion python/cudf/cudf/pandas/scripts/conftest-patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -4422,7 +4422,6 @@ def pytest_unconfigure(config):
"tests/frame/methods/test_sort_values.py::TestDataFrameSortValues::test_sort_values_by_empty_list",
"tests/frame/methods/test_sort_values.py::TestDataFrameSortValues::test_sort_values_frame_column_inplace_sort_exception",
"tests/frame/methods/test_sort_values.py::TestDataFrameSortValues::test_sort_values_item_cache",
"tests/frame/methods/test_sort_values.py::TestSortValuesLevelAsStr::test_sort_index_level_and_column_label[df_idx1-inner-True]",
"tests/frame/methods/test_to_csv.py::TestDataFrameToCSV::test_gz_lineend",
"tests/frame/methods/test_to_csv.py::TestDataFrameToCSV::test_multi_index_header",
"tests/frame/methods/test_to_csv.py::TestDataFrameToCSV::test_to_csv_from_csv1",
Expand Down
14 changes: 14 additions & 0 deletions python/cudf/cudf/tests/dataframe/methods/test_sort_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,3 +228,17 @@ def test_dataframe_loc_duplicate_index_scalar():
gdf_sorted = gdf.sort_values(by=list(gdf.columns), axis=0)

assert_eq(pdf_sorted, gdf_sorted)


def test_dataframe_sort_values_multindex():
df = cudf.DataFrame(
{"a": [2, 1, 2, 1], "b": [1, 2, 1, 2], "c": [4, 3, 2, 1]}
)
df = df.set_index(["a", "b"])
pdf = df.to_pandas()

expected = pdf.sort_values(by="a", ascending=True)
with cudf.option_context("mode.pandas_compatible", True):
result = df.sort_values(by="a", ascending=True)

assert_eq(expected, result)
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def test_notin(ibis_table_num_str):
return t.key.notin([0, 1, 8, 3]).to_pandas()


@pytest.mark.xfail(reason="Failing after Ibis 11 and DuckDB 1.4.0 upgrade")
@pytest.mark.skip(reason="Failing after Ibis 11 and DuckDB 1.4.0 upgrade")
def test_window(ibis_table_num_str):
t = ibis_table_num_str
return (
Expand Down
Loading