Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
kylebarron committed Jul 17, 2024
1 parent 8226931 commit ab015a1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion py-polars/polars/dataframe/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -1264,7 +1264,7 @@ def __deepcopy__(self, memo: None = None) -> DataFrame:
def _ipython_key_completions_(self) -> list[str]:
return self.columns

def __arrow_c_stream__(self, requested_schema: object):
def __arrow_c_stream__(self, requested_schema: object) -> object:
"""
Export a DataFrame via the Arrow PyCapsule Interface.
Expand Down
2 changes: 1 addition & 1 deletion py-polars/polars/series/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -1401,7 +1401,7 @@ def __array_ufunc__(
)
raise NotImplementedError(msg)

def __arrow_c_stream__(self, requested_schema: object):
def __arrow_c_stream__(self, requested_schema: object) -> object:
"""
Export a Series via the Arrow PyCapsule Interface.
Expand Down
9 changes: 5 additions & 4 deletions py-polars/tests/unit/interop/test_interop.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,12 +762,12 @@ class PyCapsuleStreamHolder:
used.
"""

capsule: tuple[object, object]
capsule: object

def __init__(self, capsule: tuple[object, object]):
def __init__(self, capsule: object) -> None:
self.capsule = capsule

def __arrow_c_stream__(self, requested_schema) -> tuple[object, object]:
def __arrow_c_stream__(self, requested_schema: object) -> object:
return self.capsule

df = pl.DataFrame({"a": [1, 2, 3], "b": ["a", "b", "c"]})
Expand All @@ -776,4 +776,5 @@ def __arrow_c_stream__(self, requested_schema) -> tuple[object, object]:
assert df.schema.names() == out.schema.names

df2 = pl.from_arrow(out)
assert df.equals(df2) # type: ignore
assert isinstance(df2, pl.DataFrame)
assert df.equals(df2)
6 changes: 3 additions & 3 deletions py-polars/tests/unit/series/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,12 +639,12 @@ class PyCapsuleSeriesHolder:
used.
"""

capsule: tuple[object, object]
capsule: object

def __init__(self, capsule: tuple[object, object]):
def __init__(self, capsule: object):
self.capsule = capsule

def __arrow_c_stream__(self, requested_schema: object) -> tuple[object, object]:
def __arrow_c_stream__(self, requested_schema: object) -> object:
return self.capsule

a = pl.Series("a", [1, 2, 3, None])
Expand Down

0 comments on commit ab015a1

Please sign in to comment.