Skip to content

Commit

Permalink
fix(polars): polars execute respect limit kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
gforsyth authored and cpcloud committed Feb 7, 2023
1 parent 144044d commit d962faf
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions ibis/backends/polars/__init__.py
Expand Up @@ -273,10 +273,17 @@ def execute(
self,
expr: ir.Expr,
params: Mapping[ir.Expr, object] = None,
limit: str = 'default',
limit: int | None = None,
**kwargs: Any,
):
df = self.compile(expr, params=params).collect()
lf = self.compile(expr, params=params, **kwargs)
if limit == "default":
limit = ibis.options.sql.default_limit
if limit is not None:
df = lf.fetch(limit)
else:
df = lf.collect()

if isinstance(expr, ir.Table):
return df.to_pandas()
elif isinstance(expr, ir.Column):
Expand Down

0 comments on commit d962faf

Please sign in to comment.