diff --git a/python/pyarrow/interchange/column.py b/python/pyarrow/interchange/column.py index ddbceabcb00a..f80c586ff950 100644 --- a/python/pyarrow/interchange/column.py +++ b/python/pyarrow/interchange/column.py @@ -20,7 +20,6 @@ import enum from typing import ( Any, - Dict, Iterable, Optional, Tuple, @@ -379,7 +378,7 @@ def describe_null(self) -> Tuple[ColumnNullType, Any]: return ColumnNullType.USE_BITMASK, 0 @property - def null_count(self) -> int: + def null_count(self) -> int | None: """ Number of null elements, if known. @@ -390,7 +389,7 @@ def null_count(self) -> int: return n @property - def metadata(self) -> Dict[str, Any]: + def metadata(self) -> None: """ The metadata for the column. See `DataFrame.metadata` for more details. """ @@ -466,7 +465,7 @@ def get_buffers(self) -> ColumnBuffers: def _get_data_buffer( self, - ) -> Tuple[_PyArrowBuffer, Any]: # Any is for self.dtype tuple + ) -> Tuple[_PyArrowBuffer, Any] | None: # Any is for self.dtype tuple """ Return the buffer containing the data and the buffer's associated dtype. @@ -505,7 +504,7 @@ def _get_validity_buffer(self) -> Tuple[_PyArrowBuffer, Any]: "There are no missing values so " "does not have a separate mask") - def _get_offsets_buffer(self) -> Tuple[_PyArrowBuffer, Any]: + def _get_offsets_buffer(self) -> Tuple[_PyArrowBuffer, Any] | None: """ Return the buffer containing the offset values for variable-size binary data (e.g., variable-length strings) and the buffer's associated dtype.