Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove cudf._lib.transpose in favor of inlining pylibcudf #17365

Merged
merged 5 commits into from
Nov 22, 2024
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
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
Loading