-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
ecf5334
commit b309a57
Showing
3 changed files
with
26 additions
and
38 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
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
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,22 @@ | ||
from typing import Any | ||
|
||
|
||
class PyCapsuleStreamHolder: | ||
""" | ||
Hold the Arrow C Stream pycapsule. | ||
A class that exposes _only_ the Arrow C Stream interface via Arrow PyCapsules. | ||
This ensures that pyarrow is seeing _only_ the `__arrow_c_stream__` dunder, and | ||
that nothing else (e.g. the dataframe or array interface) is actually being | ||
used. | ||
This is used by tests across multiple files. | ||
""" | ||
|
||
arrow_obj: Any | ||
|
||
def __init__(self, arrow_obj: object) -> None: | ||
self.arrow_obj = arrow_obj | ||
|
||
def __arrow_c_stream__(self, requested_schema: object = None) -> object: | ||
return self.arrow_obj.__arrow_c_stream__(requested_schema) |