From 1caa64f3967ff5b98a0e7b6ab05cb0d45adcb7b5 Mon Sep 17 00:00:00 2001 From: Michael Wang Date: Fri, 4 Feb 2022 18:05:30 -0800 Subject: [PATCH] Update python/cudf/cudf/core/dataframe.py Co-authored-by: Bradley Dice --- python/cudf/cudf/core/dataframe.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/python/cudf/cudf/core/dataframe.py b/python/cudf/cudf/core/dataframe.py index 13648bce8b1..1936ebaea98 100644 --- a/python/cudf/cudf/core/dataframe.py +++ b/python/cudf/cudf/core/dataframe.py @@ -5872,9 +5872,7 @@ def to_struct(self, name=None): "requires field name to be string. Non-string column names will " "be casted to string as the field name." ) - field_names = [str(name) for name in self._data.names] - else: - field_names = self._data.names + field_names = [str(name) for name in self._data.names] col = cudf.core.column.build_struct_column( names=field_names, children=self._data.columns, size=len(self)