Skip to content

Commit

Permalink
fix(python): Fix typing for DataFrame.select (#6047)
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego committed Jan 5, 2023
1 parent 42bfd87 commit b4ffc80
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion py-polars/polars/internals/dataframe/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -5363,7 +5363,7 @@ def select(
exprs: str
| pli.Expr
| pli.Series
| Sequence[str | pli.Expr | pli.Series | pli.WhenThen | pli.WhenThenThen],
| Iterable[str | pli.Expr | pli.Series | pli.WhenThen | pli.WhenThenThen],
) -> DF:
"""
Select columns from this DataFrame.
Expand Down
4 changes: 2 additions & 2 deletions py-polars/polars/internals/expr/expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import random
import warnings
from datetime import date, datetime, time, timedelta
from typing import TYPE_CHECKING, Any, Callable, NoReturn, Sequence, cast
from typing import TYPE_CHECKING, Any, Callable, Iterable, NoReturn, Sequence, cast

from polars import internals as pli
from polars.datatypes import (
Expand Down Expand Up @@ -50,7 +50,7 @@ def selection_to_pyexpr_list(
exprs: str
| Expr
| pli.Series
| Sequence[
| Iterable[
str
| Expr
| pli.Series
Expand Down
13 changes: 11 additions & 2 deletions py-polars/polars/internals/lazyframe/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,16 @@
from datetime import date, datetime, time, timedelta
from io import BytesIO, IOBase, StringIO
from pathlib import Path
from typing import TYPE_CHECKING, Any, Callable, NoReturn, Sequence, TypeVar, overload
from typing import (
TYPE_CHECKING,
Any,
Callable,
Iterable,
NoReturn,
Sequence,
TypeVar,
overload,
)
from warnings import warn

from polars import internals as pli
Expand Down Expand Up @@ -1498,7 +1507,7 @@ def select(
exprs: str
| pli.Expr
| pli.Series
| Sequence[str | pli.Expr | pli.Series | pli.WhenThen | pli.WhenThenThen],
| Iterable[str | pli.Expr | pli.Series | pli.WhenThen | pli.WhenThenThen],
) -> LDF:
"""
Select columns from this DataFrame.
Expand Down

0 comments on commit b4ffc80

Please sign in to comment.