Skip to content

Commit

Permalink
feat: In explain(), rename PIPELINE to STREAMING so it's clearer what…
Browse files Browse the repository at this point in the history
… it means (#12547)

Co-authored-by: Itamar Turner-Trauring <[email protected]>
  • Loading branch information
itamarst and pythonspeed authored Nov 17, 2023
1 parent 0c56f9b commit e461ffc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions crates/polars-plan/src/logical_plan/functions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -385,12 +385,12 @@ impl Display for FunctionNode {
MergeSorted { .. } => write!(f, "MERGE SORTED"),
Pipeline { original, .. } => {
if let Some(original) = original {
writeln!(f, "--- PIPELINE")?;
writeln!(f, "--- STREAMING")?;
write!(f, "{:?}", original.as_ref())?;
let indent = 2;
writeln!(f, "{:indent$}--- END PIPELINE", "")
writeln!(f, "{:indent$}--- END STREAMING", "")
} else {
writeln!(f, "PIPELINE")
writeln!(f, "STREAMING")
}
},
Rename { .. } => write!(f, "RENAME"),
Expand Down
2 changes: 1 addition & 1 deletion py-polars/tests/unit/streaming/test_streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def test_streaming_ternary() -> None:
pl.when(pl.col("a") >= 2).then(pl.col("a")).otherwise(None).alias("b"),
)
.explain(streaming=True)
.startswith("--- PIPELINE")
.startswith("--- STREAMING")
)


Expand Down
2 changes: 1 addition & 1 deletion py-polars/tests/unit/streaming/test_streaming_cse.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def test_cse_expr_group_by() -> None:
# check if it uses CSE_expr
# and is a complete pipeline
assert "__POLARS_CSER" in s
assert s.startswith("--- PIPELINE")
assert s.startswith("--- STREAMING")

expected = pl.DataFrame(
{"a": [1, 2, 3, 4], "sum": [1, 4, 9, 16], "min": [1, 4, 9, 16]}
Expand Down
2 changes: 1 addition & 1 deletion py-polars/tests/unit/streaming/test_streaming_group_by.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ def test_streaming_restart_non_streamable_group_by() -> None:
) # non-streamable UDF + nested_agg
)

assert """--- PIPELINE""" in res.explain(streaming=True)
assert """--- STREAMING""" in res.explain(streaming=True)


def test_group_by_min_max_string_type() -> None:
Expand Down

0 comments on commit e461ffc

Please sign in to comment.