Skip to content

Commit 053fdbd

Browse files
paddyroddyrok
andcommitted
GH-12: [Python] Fix invalid-return-type error (#25)
* Add py.typed file to signify that the library is typed See the relevant PEP https://peps.python.org/pep-0561 * Prepare `pyarrow-stubs` for history merging MINOR: [Python] Prepare `pyarrow-stubs` for history merging Co-authored-by: ZhengYu, Xu <zen-xu@outlook.com> * Add `ty` configuration and suppress error codes * One line per rule * Add licence header from original repo for all `.pyi` files * Revert "Add licence header from original repo for all `.pyi` files" This reverts commit 1631f39. * Prepare for licence merging * Exclude `stubs` from `rat` test * Add Apache licence clause to `py.typed` * Reduce list * Add `ty` as a step in the action * Run in the correct directory * Remove `check` from `pip` * Fix `unresolved-reference` error * Revert "Fix `unresolved-reference` error" This reverts commit 7ee3d2f. * Fix `invalid-return-type` error * Fix linting --------- Co-authored-by: Rok Mihevc <rok@mihevc.org>
1 parent 42c73d5 commit 053fdbd

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

python/pyarrow/interchange/column.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import enum
2121
from typing import (
2222
Any,
23-
Dict,
2423
Iterable,
2524
Optional,
2625
Tuple,
@@ -379,7 +378,7 @@ def describe_null(self) -> Tuple[ColumnNullType, Any]:
379378
return ColumnNullType.USE_BITMASK, 0
380379

381380
@property
382-
def null_count(self) -> int:
381+
def null_count(self) -> int | None:
383382
"""
384383
Number of null elements, if known.
385384
@@ -390,7 +389,7 @@ def null_count(self) -> int:
390389
return n
391390

392391
@property
393-
def metadata(self) -> Dict[str, Any]:
392+
def metadata(self) -> None:
394393
"""
395394
The metadata for the column. See `DataFrame.metadata` for more details.
396395
"""
@@ -466,7 +465,7 @@ def get_buffers(self) -> ColumnBuffers:
466465

467466
def _get_data_buffer(
468467
self,
469-
) -> Tuple[_PyArrowBuffer, Any]: # Any is for self.dtype tuple
468+
) -> Tuple[_PyArrowBuffer, Any] | None: # Any is for self.dtype tuple
470469
"""
471470
Return the buffer containing the data and the buffer's
472471
associated dtype.
@@ -505,7 +504,7 @@ def _get_validity_buffer(self) -> Tuple[_PyArrowBuffer, Any]:
505504
"There are no missing values so "
506505
"does not have a separate mask")
507506

508-
def _get_offsets_buffer(self) -> Tuple[_PyArrowBuffer, Any]:
507+
def _get_offsets_buffer(self) -> Tuple[_PyArrowBuffer, Any] | None:
509508
"""
510509
Return the buffer containing the offset values for variable-size binary
511510
data (e.g., variable-length strings) and the buffer's associated dtype.

0 commit comments

Comments
 (0)