-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f98d685
commit 8428903
Showing
3 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
from typing import Self | ||
from numpy.typing import NDArray | ||
|
||
from .types import ArrowArrayExportable, ArrowSchemaExportable, ArrowStreamExportable | ||
|
||
class Array: | ||
def __array__(self) -> NDArray: ... | ||
def __arrow_c_array__(self, requested_schema) -> object: ... | ||
def __eq__(self) -> bool: ... | ||
def __len__(self) -> bool: ... | ||
@classmethod | ||
def from_arrow(cls, input: ArrowArrayExportable) -> Self: ... | ||
def to_numpy(self) -> NDArray: ... | ||
|
||
class ChunkedArray: | ||
def __array__(self) -> NDArray: ... | ||
def __arrow_c_stream__(self, requested_schema) -> object: ... | ||
def __eq__(self) -> bool: ... | ||
def __len__(self) -> bool: ... | ||
@classmethod | ||
def from_arrow(cls, input: ArrowStreamExportable) -> Self: ... | ||
def to_numpy(self) -> NDArray: ... | ||
|
||
class Field: | ||
def __arrow_c_schema__(self) -> object: ... | ||
def __eq__(self) -> bool: ... | ||
@classmethod | ||
def from_arrow(cls, input: ArrowSchemaExportable) -> Self: ... | ||
|
||
class RecordBatch: | ||
def __arrow_c_array__(self, requested_schema) -> object: ... | ||
def __eq__(self) -> bool: ... | ||
@classmethod | ||
def from_arrow(cls, input: ArrowArrayExportable) -> Self: ... | ||
|
||
class RecordBatchReader: | ||
def __arrow_c_stream__(self, requested_schema) -> object: ... | ||
@classmethod | ||
def from_arrow(cls, input: ArrowStreamExportable) -> Self: ... | ||
def schema(self) -> Schema: ... | ||
|
||
class Schema: | ||
def __arrow_c_schema__(self) -> object: ... | ||
def __eq__(self) -> bool: ... | ||
@classmethod | ||
def from_arrow(cls, input: ArrowSchemaExportable) -> Self: ... | ||
|
||
class Table: | ||
def __arrow_c_stream__(self, requested_schema) -> object: ... | ||
def __eq__(self) -> bool: ... | ||
def __len__(self) -> bool: ... | ||
@classmethod | ||
def from_arrow(cls, input: ArrowStreamExportable) -> Self: ... | ||
def schema(self) -> Schema: ... |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from __future__ import annotations | ||
|
||
from typing import Protocol, Tuple | ||
|
||
|
||
class ArrowSchemaExportable(Protocol): | ||
"""An Arrow or GeoArrow schema or field.""" | ||
|
||
def __arrow_c_schema__(self) -> object: ... | ||
|
||
|
||
class ArrowArrayExportable(Protocol): | ||
"""An Arrow or GeoArrow array or RecordBatch.""" | ||
|
||
def __arrow_c_array__( | ||
self, requested_schema: object | None = None | ||
) -> Tuple[object, object]: ... | ||
|
||
|
||
class ArrowStreamExportable(Protocol): | ||
"""An Arrow or GeoArrow ChunkedArray or Table.""" | ||
|
||
def __arrow_c_stream__(self, requested_schema: object | None = None) -> object: ... |