Skip to content

Commit

Permalink
Raise a more helpful TypeError when trying to subscript a LazyFrame. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ghuls committed Jun 1, 2022
1 parent 5b23e4e commit 91d02cd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions py-polars/polars/internals/lazy_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,11 @@ def _scan_python_function(cls, schema: "pa.schema", scan_fn: bytes) -> "LazyFram
self._ldf = PyLazyFrame.scan_from_python_function(list(schema), scan_fn)
return self

def __getitem__(self, item: Union[int, range, slice]) -> None:
raise TypeError(
"'LazyFrame' object is not subscriptable. Use 'select()' or 'filter()' instead."
)

def pipe(self, func: Callable[..., Any], *args: Any, **kwargs: Any) -> Any:
"""
Apply a function on Self.
Expand Down

0 comments on commit 91d02cd

Please sign in to comment.