Skip to content

Commit 8cdbe0b

Browse files
authored
Avoid Column materialization in RangeIndex.nans_to_nulls (#20331)
Follow up to #20314 Realized after review we can avoid materializing the `range` to a `Column` Authors: - Matthew Roeschke (https://github.com/mroeschke) Approvers: - GALI PREM SAGAR (https://github.com/galipremsagar) URL: #20331
1 parent d3ce8be commit 8cdbe0b

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

python/cudf/cudf/core/frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def deserialize(cls, header, frames):
182182
return cls._from_data(col_accessor)
183183

184184
@_performance_tracking
185-
def nans_to_nulls(self):
185+
def nans_to_nulls(self) -> Self:
186186
result = []
187187
for col in self._columns:
188188
converted = col.nans_to_nulls()

python/cudf/cudf/core/index.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3413,6 +3413,10 @@ def isin(self, values, level=None) -> cupy.ndarray:
34133413

34143414
return self._column.isin(values).values
34153415

3416+
@_performance_tracking
3417+
def nans_to_nulls(self) -> Self:
3418+
return self.copy()
3419+
34163420
def __pos__(self) -> Self:
34173421
return self.copy()
34183422

python/cudf/cudf/core/indexed_frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1890,7 +1890,7 @@ def ewm(
18901890
)
18911891

18921892
@_performance_tracking
1893-
def nans_to_nulls(self):
1893+
def nans_to_nulls(self) -> Self:
18941894
"""
18951895
Convert nans (if any) to nulls
18961896

0 commit comments

Comments
 (0)