From 25e9527d63de42eab0646cc09d830656aeab8060 Mon Sep 17 00:00:00 2001 From: Michael Wang Date: Wed, 9 Mar 2022 15:47:45 -0800 Subject: [PATCH] Use iterable as typing istead of list for `column_names` arg --- python/cudf/cudf/core/dataframe.py | 4 ++-- python/cudf/cudf/core/frame.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/python/cudf/cudf/core/dataframe.py b/python/cudf/cudf/core/dataframe.py index 6e0c64f78fe..991c5d18b92 100644 --- a/python/cudf/cudf/core/dataframe.py +++ b/python/cudf/cudf/core/dataframe.py @@ -1320,7 +1320,7 @@ def _slice(self: T, arg: slice) -> T: ] result = self._from_columns_like_self( libcudf.copying.columns_slice(columns_to_slice, [start, stop])[0], - [*self._column_names], + self._column_names, None if is_range_index else self._index.names, ) @@ -6065,7 +6065,7 @@ def _sample_axis_1( def _from_columns_like_self( self, columns: List[ColumnBase], - column_names: List[str], + column_names: Iterable[str], index_names: Optional[List[str]] = None, ) -> DataFrame: result = super()._from_columns_like_self( diff --git a/python/cudf/cudf/core/frame.py b/python/cudf/cudf/core/frame.py index aba2b6d1a11..06a8fee46c3 100644 --- a/python/cudf/cudf/core/frame.py +++ b/python/cudf/cudf/core/frame.py @@ -200,7 +200,7 @@ def _from_data( def _from_columns( cls, columns: List[ColumnBase], - column_names: List[str], + column_names: abc.Iterable[str], index_names: Optional[List[str]] = None, ): """Construct a `Frame` object from a list of columns. @@ -233,7 +233,7 @@ def _from_columns( def _from_columns_like_self( self, columns: List[ColumnBase], - column_names: List[str], + column_names: abc.Iterable[str], index_names: Optional[List[str]] = None, ): """Construct a `Frame` from a list of columns with metadata from self.