Skip to content

Commit

Permalink
Remove cudf._lib.transpose in favor of inlining pylibcudf (#17365)
Browse files Browse the repository at this point in the history
Contributes to #17317

Authors:
  - Matthew Roeschke (https://github.com/mroeschke)

Approvers:
  - Matthew Murray (https://github.com/Matt711)
  - Kyle Edwards (https://github.com/KyleFromNVIDIA)

URL: #17365
  • Loading branch information
mroeschke authored Nov 22, 2024
1 parent 5a89d00 commit 881afd1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 21 deletions.
1 change: 0 additions & 1 deletion python/cudf/cudf/_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ set(cython_sources
text.pyx
timezone.pyx
transform.pyx
transpose.pyx
types.pyx
utils.pyx
)
Expand Down
1 change: 0 additions & 1 deletion python/cudf/cudf/_lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
strings_udf,
text,
timezone,
transpose,
)

MAX_COLUMN_SIZE = np.iinfo(np.int32).max
Expand Down
18 changes: 0 additions & 18 deletions python/cudf/cudf/_lib/transpose.pyx

This file was deleted.

10 changes: 9 additions & 1 deletion python/cudf/cudf/core/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -4113,7 +4113,15 @@ def transpose(self):
if any(c.dtype != source_columns[0].dtype for c in source_columns):
raise ValueError("Columns must all have the same dtype")

result_columns = libcudf.transpose.transpose(source_columns)
result_table = plc.transpose.transpose(
plc.table.Table(
[col.to_pylibcudf(mode="read") for col in source_columns]
)
)
result_columns = [
libcudf.column.Column.from_pylibcudf(col, data_ptr_exposed=True)
for col in result_table.columns()
]

if isinstance(source_dtype, cudf.CategoricalDtype):
result_columns = [
Expand Down

0 comments on commit 881afd1

Please sign in to comment.