Skip to content

Commit

Permalink
Return a Tuple, not a List
Browse files Browse the repository at this point in the history
  • Loading branch information
shwina committed Feb 14, 2022
1 parent 1c73cc0 commit 6768825
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions python/cudf/cudf/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,22 +90,22 @@ def _num_rows(self) -> int:
return len(self._data.columns[0])

@property
def _column_names(self) -> List[Any]: # TODO: List[str]?
return list(self._data.names)
def _column_names(self) -> Tuple[Any, ...]: # TODO: Tuple[str]?
return tuple(self._data.names)

@property
def _index_names(self) -> List[Any]: # TODO: List[str]?
def _index_names(self) -> Optional[Tuple[Any, ...]]: # TODO: Tuple[str]?
# TODO: Temporarily suppressing mypy warnings to avoid introducing bugs
# by returning an empty list where one is not expected.
return (
None # type: ignore
if self._index is None
else self._index._data.names
else tuple(self._index._data.names)
)

@property
def _columns(self) -> List[Any]: # TODO: List[Column]?
return list(self._data.columns)
def _columns(self) -> Tuple[Any, ...]: # TODO: Tuple[Column]?
return tuple(self._data.columns)

def serialize(self):
header = {
Expand Down

0 comments on commit 6768825

Please sign in to comment.