-
Notifications
You must be signed in to change notification settings - Fork 170
fix(typing): Narrow TypeVar(s) used in (Data|Lazy)Frame
#2356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 15 commits
aa6578e
51c5b63
6cbbc74
255ab27
ba2f6e1
1815752
07deea2
3881822
375fabc
21e80ef
c124985
831a6be
1725f36
c4bed59
6a9fd91
ed65ad2
b97149d
6a66779
675329c
5dd7825
a1c51ff
c2b328b
b66d1bf
ba525f1
c45f1f4
322b00d
d6cb16b
cbd60d9
53722e8
e111fc3
23158d1
bc72941
a1fb349
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -76,7 +76,6 @@ class PolarsDataFrame: | |
| select: Method[Self] | ||
| sort: Method[Self] | ||
| to_arrow: Method[pa.Table] | ||
| to_numpy: Method[_2DArray] | ||
| to_pandas: Method[pd.DataFrame] | ||
| unique: Method[Self] | ||
| with_columns: Method[Self] | ||
|
|
@@ -231,6 +230,9 @@ def __array__( | |
| return self.native.__array__(dtype) | ||
| return self.native.__array__(dtype) | ||
|
|
||
| def to_numpy(self, dtype: Any = None, *, copy: bool | None = None) -> _2DArray: | ||
| return self.native.to_numpy() | ||
|
|
||
| def collect_schema(self: Self) -> dict[str, DType]: | ||
| if self._backend_version < (1,): | ||
| return { | ||
|
|
@@ -411,15 +413,14 @@ def unpivot( | |
| ) | ||
|
|
||
| def pivot( | ||
| self: Self, | ||
| on: list[str], | ||
| self, | ||
| on: str | Sequence[str], | ||
| *, | ||
| index: list[str] | None, | ||
| values: list[str] | None, | ||
| index: str | Sequence[str] | None, | ||
| values: str | Sequence[str] | None, | ||
|
||
| aggregate_function: Literal[ | ||
| "min", "max", "first", "last", "sum", "mean", "median", "len" | ||
| ] | ||
| | None, | ||
| "min", "max", "first", "last", "sum", "mean", "median", "len", None | ||
| ], | ||
| sort_columns: bool, | ||
| separator: str, | ||
| ) -> Self: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@FBruzzesi I forgot to mention this will probably be helpful in getting the typing working for (#2325).
It means you can use
CompliantGroupByforPolars*and put the unrelated parts here.I needed to add it to resolve an unrelated issue (1815752)