Skip to content

Commit

Permalink
Add Series to with_columns() argument annotations (#3696)
Browse files Browse the repository at this point in the history
Co-authored-by: Adam Gregory <adam.gregory@diasemi.com>
  • Loading branch information
adamgreg and Adam Gregory committed Jun 17, 2022
1 parent 25e9e35 commit af3327e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion py-polars/polars/internals/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -4696,7 +4696,10 @@ def select(
.collect(no_optimization=True, string_cache=False)
)

def with_columns(self: DF, exprs: Union["pli.Expr", List["pli.Expr"]]) -> DF:
def with_columns(
self: DF,
exprs: Union["pli.Expr", "pli.Series", List[Union["pli.Expr", "pli.Series"]]],
) -> DF:
"""
Add or overwrite multiple columns in a DataFrame.
Expand Down
5 changes: 4 additions & 1 deletion py-polars/polars/internals/lazy_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -1430,7 +1430,10 @@ def join(
)
)

def with_columns(self: LDF, exprs: Union[List["pli.Expr"], "pli.Expr"]) -> LDF:
def with_columns(
self: LDF,
exprs: Union["pli.Expr", "pli.Series", List[Union["pli.Expr", "pli.Series"]]],
) -> LDF:
"""
Add or overwrite multiple columns in a DataFrame.
Expand Down

0 comments on commit af3327e

Please sign in to comment.