Skip to content

Commit

Permalink
refactor(python): Don't rely on argument order of optimization_toggle (
Browse files Browse the repository at this point in the history
  • Loading branch information
orlp authored Jan 8, 2025
1 parent 044bc51 commit 8ec4379
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 91 deletions.
44 changes: 22 additions & 22 deletions py-polars/polars/functions/lazy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1697,17 +1697,17 @@ def collect_all(
for lf in lazy_frames:
type_check = _type_check
ldf = lf._ldf.optimization_toggle(
type_coercion,
type_check,
predicate_pushdown,
projection_pushdown,
simplify_expression,
slice_pushdown,
comm_subplan_elim,
comm_subexpr_elim,
cluster_with_columns,
collapse_joins,
streaming,
type_coercion=type_coercion,
type_check=type_check,
predicate_pushdown=predicate_pushdown,
projection_pushdown=projection_pushdown,
simplify_expression=simplify_expression,
slice_pushdown=slice_pushdown,
comm_subplan_elim=comm_subplan_elim,
comm_subexpr_elim=comm_subexpr_elim,
cluster_with_columns=cluster_with_columns,
collapse_joins=collapse_joins,
streaming=streaming,
_eager=False,
_check_order=_check_order,
new_streaming=False,
Expand Down Expand Up @@ -1869,17 +1869,17 @@ def collect_all_async(
for lf in lazy_frames:
type_check = _type_check
ldf = lf._ldf.optimization_toggle(
type_coercion,
type_check,
predicate_pushdown,
projection_pushdown,
simplify_expression,
slice_pushdown,
comm_subplan_elim,
comm_subexpr_elim,
cluster_with_columns,
collapse_joins,
streaming,
type_coercion=type_coercion,
type_check=type_check,
predicate_pushdown=predicate_pushdown,
projection_pushdown=projection_pushdown,
simplify_expression=simplify_expression,
slice_pushdown=slice_pushdown,
comm_subplan_elim=comm_subplan_elim,
comm_subexpr_elim=comm_subexpr_elim,
cluster_with_columns=cluster_with_columns,
collapse_joins=collapse_joins,
streaming=streaming,
_eager=False,
_check_order=_check_order,
new_streaming=False,
Expand Down
138 changes: 69 additions & 69 deletions py-polars/polars/lazyframe/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -1099,17 +1099,17 @@ def explain(
if optimized:
type_check = _type_check
ldf = self._ldf.optimization_toggle(
type_coercion,
type_check,
predicate_pushdown,
projection_pushdown,
simplify_expression,
slice_pushdown,
comm_subplan_elim,
comm_subexpr_elim,
cluster_with_columns,
collapse_joins,
streaming,
type_coercion=type_coercion,
type_check=type_check,
predicate_pushdown=predicate_pushdown,
projection_pushdown=projection_pushdown,
simplify_expression=simplify_expression,
slice_pushdown=slice_pushdown,
comm_subplan_elim=comm_subplan_elim,
comm_subexpr_elim=comm_subexpr_elim,
cluster_with_columns=cluster_with_columns,
collapse_joins=collapse_joins,
streaming=streaming,
_eager=False,
_check_order=_check_order,
new_streaming=False,
Expand Down Expand Up @@ -1199,17 +1199,17 @@ def show_graph(
"""
type_check = _type_check
_ldf = self._ldf.optimization_toggle(
type_coercion,
type_check,
predicate_pushdown,
projection_pushdown,
simplify_expression,
slice_pushdown,
comm_subplan_elim,
comm_subexpr_elim,
cluster_with_columns,
collapse_joins,
streaming,
type_coercion=type_coercion,
type_check=type_check,
predicate_pushdown=predicate_pushdown,
projection_pushdown=projection_pushdown,
simplify_expression=simplify_expression,
slice_pushdown=slice_pushdown,
comm_subplan_elim=comm_subplan_elim,
comm_subexpr_elim=comm_subexpr_elim,
cluster_with_columns=cluster_with_columns,
collapse_joins=collapse_joins,
streaming=streaming,
_eager=False,
_check_order=_check_order,
new_streaming=False,
Expand Down Expand Up @@ -1708,17 +1708,17 @@ def profile(

type_check = _type_check
ldf = self._ldf.optimization_toggle(
type_coercion,
type_check,
predicate_pushdown,
projection_pushdown,
simplify_expression,
slice_pushdown,
comm_subplan_elim,
comm_subexpr_elim,
cluster_with_columns,
collapse_joins,
streaming,
type_coercion=type_coercion,
type_check=type_check,
predicate_pushdown=predicate_pushdown,
projection_pushdown=projection_pushdown,
simplify_expression=simplify_expression,
slice_pushdown=slice_pushdown,
comm_subplan_elim=comm_subplan_elim,
comm_subexpr_elim=comm_subexpr_elim,
cluster_with_columns=cluster_with_columns,
collapse_joins=collapse_joins,
streaming=streaming,
_eager=False,
_check_order=_check_order,
new_streaming=False,
Expand Down Expand Up @@ -2017,20 +2017,20 @@ def collect(

type_check = _type_check
ldf = self._ldf.optimization_toggle(
type_coercion,
type_check,
predicate_pushdown,
projection_pushdown,
simplify_expression,
slice_pushdown,
comm_subplan_elim,
comm_subexpr_elim,
cluster_with_columns,
collapse_joins,
streaming,
_eager,
_check_order,
new_streaming,
type_coercion=type_coercion,
type_check=type_check,
predicate_pushdown=predicate_pushdown,
projection_pushdown=projection_pushdown,
simplify_expression=simplify_expression,
slice_pushdown=slice_pushdown,
comm_subplan_elim=comm_subplan_elim,
comm_subexpr_elim=comm_subexpr_elim,
cluster_with_columns=cluster_with_columns,
collapse_joins=collapse_joins,
streaming=streaming,
_eager=_eager,
_check_order=_check_order,
new_streaming=new_streaming,
)

if background:
Expand Down Expand Up @@ -2222,17 +2222,17 @@ def collect_async(

type_check = _type_check
ldf = self._ldf.optimization_toggle(
type_coercion,
type_check,
predicate_pushdown,
projection_pushdown,
simplify_expression,
slice_pushdown,
comm_subplan_elim,
comm_subexpr_elim,
cluster_with_columns,
collapse_joins,
streaming,
type_coercion=type_coercion,
type_check=type_check,
predicate_pushdown=predicate_pushdown,
projection_pushdown=projection_pushdown,
simplify_expression=simplify_expression,
slice_pushdown=slice_pushdown,
comm_subplan_elim=comm_subplan_elim,
comm_subexpr_elim=comm_subexpr_elim,
cluster_with_columns=cluster_with_columns,
collapse_joins=collapse_joins,
streaming=streaming,
_eager=False,
_check_order=_check_order,
new_streaming=False,
Expand Down Expand Up @@ -3089,17 +3089,17 @@ def _fetch(

type_check = _type_check
lf = self._ldf.optimization_toggle(
type_coercion,
type_check,
predicate_pushdown,
projection_pushdown,
simplify_expression,
slice_pushdown,
comm_subplan_elim,
comm_subexpr_elim,
cluster_with_columns,
collapse_joins,
streaming,
type_coercion=type_coercion,
type_check=type_check,
predicate_pushdown=predicate_pushdown,
projection_pushdown=projection_pushdown,
simplify_expression=simplify_expression,
slice_pushdown=slice_pushdown,
comm_subplan_elim=comm_subplan_elim,
comm_subexpr_elim=comm_subexpr_elim,
cluster_with_columns=cluster_with_columns,
collapse_joins=collapse_joins,
streaming=streaming,
_eager=False,
_check_order=_check_order,
new_streaming=False,
Expand Down

0 comments on commit 8ec4379

Please sign in to comment.