Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt711 committed Nov 18, 2024
1 parent 496d664 commit d6b3667
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
11 changes: 10 additions & 1 deletion python/cudf/cudf/_lib/json.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ from cudf._lib.column cimport Column
from cudf._lib.io.utils cimport add_df_col_struct_names
from cudf._lib.types cimport dtype_to_pylibcudf_type
from cudf._lib.utils cimport _data_from_columns, data_from_pylibcudf_io
from cudf._lib.utils import _dtype_to_names_list

import pylibcudf as plc

Expand Down Expand Up @@ -200,3 +199,13 @@ def _get_cudf_schema_element_from_dtype(object dtype):
]

return lib_type, child_types


def _dtype_to_names_list(col):
if isinstance(col.dtype, cudf.StructDtype):
return [(name, _dtype_to_names_list(child))
for name, child in zip(col.dtype.fields, col.children)]
elif isinstance(col.dtype, cudf.ListDtype):
return [("", _dtype_to_names_list(child))
for child in col.children]
return []
10 changes: 0 additions & 10 deletions python/cudf/cudf/_lib/utils.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -398,13 +398,3 @@ cdef data_from_table_view(
source_column_idx += 1

return dict(zip(column_names, data_columns)), index


def _dtype_to_names_list(col):
if isinstance(col.dtype, cudf.StructDtype):
return [(name, _dtype_to_names_list(child))
for name, child in zip(col.dtype.fields, col.children)]
elif isinstance(col.dtype, cudf.ListDtype):
return [("", _dtype_to_names_list(child))
for child in col.children]
return []

0 comments on commit d6b3667

Please sign in to comment.