Skip to content

Commit

Permalink
docs: Fix some warnings during doc build
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego committed Jun 19, 2024
1 parent 760067c commit f6fcee1
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
4 changes: 3 additions & 1 deletion docs/_build/API_REFERENCE_LINKS.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
python:
DataFrame: https://docs.pola.rs/api/python/stable/reference/dataframe/index.html
Categorical: https://docs.pola.rs/api/python/stable/reference/api/polars.Categorical.html
LazyFrame: https://docs.pola.rs/api/python/stable/reference/lazyframe/index.html
Series: https://docs.pola.rs/api/python/stable/reference/series/index.html
Categorical: https://docs.pola.rs/api/python/stable/reference/api/polars.Categorical.html
select: https://docs.pola.rs/api/python/stable/reference/dataframe/api/polars.DataFrame.select.html
filter: https://docs.pola.rs/api/python/stable/reference/dataframe/api/polars.DataFrame.filter.html
with_columns: https://docs.pola.rs/api/python/stable/reference/dataframe/api/polars.DataFrame.with_columns.html
Expand Down Expand Up @@ -151,6 +152,7 @@ python:

rust:
DataFrame: https://docs.pola.rs/api/rust/dev/polars/frame/struct.DataFrame.html
LazyFrame: https://docs.pola.rs/api/rust/dev/polars/prelude/struct.LazyFrame.html
Series: https://docs.pola.rs/api/rust/dev/polars/series/struct.Series.html
Categorical:
name: Categorical
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,18 @@ def add_counter(val: int) -> int:


out = df.select(
pl.col("values").map_elements(add_counter).alias("solution_map_elements"),
pl.col("values")
.map_elements(add_counter, return_dtype=pl.Int64)
.alias("solution_map_elements"),
(pl.col("values") + pl.int_range(1, pl.len() + 1)).alias("solution_expr"),
)
print(out)
# --8<-- [end:counter]

# --8<-- [start:combine]
out = df.select(
pl.struct(["keys", "values"])
.map_elements(lambda x: len(x["keys"]) + x["values"])
pl.struct("keys", "values")
.map_elements(lambda x: len(x["keys"]) + x["values"], return_dtype=pl.Int64)
.alias("solution_map_elements"),
(pl.col("keys").str.len_bytes() + pl.col("values")).alias("solution_expr"),
)
Expand Down
8 changes: 6 additions & 2 deletions py-polars/polars/lazyframe/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -1041,6 +1041,9 @@ def explain(
if tree_format:
format = "tree"

if streaming:
issue_unstable_warning("Streaming mode is considered unstable.")

if optimized:
ldf = self._ldf.optimization_toggle(
type_coercion,
Expand Down Expand Up @@ -1872,7 +1875,6 @@ def collect(

if streaming:
issue_unstable_warning("Streaming mode is considered unstable.")
comm_subplan_elim = False

ldf = self._ldf.optimization_toggle(
type_coercion,
Expand Down Expand Up @@ -2048,7 +2050,6 @@ def collect_async(

if streaming:
issue_unstable_warning("Streaming mode is considered unstable.")
comm_subplan_elim = False

ldf = self._ldf.optimization_toggle(
type_coercion,
Expand Down Expand Up @@ -2622,6 +2623,9 @@ def fetch(
comm_subexpr_elim = False
cluster_with_columns = False

if streaming:
issue_unstable_warning("Streaming mode is considered unstable.")

lf = self._ldf.optimization_toggle(
type_coercion,
predicate_pushdown,
Expand Down
5 changes: 4 additions & 1 deletion py-polars/src/lazyframe/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ impl PyLazyFrame {
projection_pushdown: bool,
simplify_expr: bool,
slice_pushdown: bool,
comm_subplan_elim: bool,
mut comm_subplan_elim: bool,
comm_subexpr_elim: bool,
cluster_with_columns: bool,
streaming: bool,
Expand All @@ -512,6 +512,9 @@ impl PyLazyFrame {
ldf = ldf.with_new_streaming(new_streaming);
}

if streaming {
comm_subplan_elim = false;
}
#[cfg(feature = "cse")]
{
ldf = ldf.with_comm_subplan_elim(comm_subplan_elim);
Expand Down

0 comments on commit f6fcee1

Please sign in to comment.