Skip to content

Commit

Permalink
deprecate df[[col(foo)]] syntax (#3286)
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed May 2, 2022
1 parent 1db6267 commit 29e1737
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions py-polars/polars/internals/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -1599,6 +1599,10 @@ def __getitem__(
Does quite a lot. Read the comments.
"""
if isinstance(item, pli.Expr):
warnings.warn(
"'using expressions in []' is deprecated. please use 'select'",
DeprecationWarning,
)
return self.select(item)
# select rows and columns at once
# every 2d selection, i.e. tuple is row column order, just like numpy
Expand Down

0 comments on commit 29e1737

Please sign in to comment.