Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Fix some warnings during doc build #17077

Merged
merged 4 commits into from
Jun 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions crates/polars-lazy/src/frame/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -606,9 +606,6 @@ impl LazyFrame {
let streaming = self.opt_state.streaming;
#[cfg(feature = "cse")]
if streaming && self.opt_state.comm_subplan_elim {
polars_warn!(
"Cannot combine 'streaming' with 'comm_subplan_elim'. CSE will be turned off."
);
opt_state.comm_subplan_elim = false;
}
let lp_top = optimize(
Expand Down
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
17 changes: 15 additions & 2 deletions py-polars/polars/lazyframe/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -1013,6 +1013,11 @@ def explain(
Combine sequential independent calls to with_columns
streaming
Run parts of the query in a streaming fashion (this is in an alpha state)

.. warning::
Streaming mode is considered **unstable**. It may be changed
at any point without it being considered a breaking change.

tree_format
Format the output as a tree.

Expand Down Expand Up @@ -1041,6 +1046,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 +1880,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 +2055,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 @@ -2576,6 +2582,10 @@ def fetch(
streaming
Run parts of the query in a streaming fashion (this is in an alpha state)

.. warning::
Streaming mode is considered **unstable**. It may be changed
at any point without it being considered a breaking change.

Notes
-----
This is similar to a :func:`collect` operation, but it overwrites the number of
Expand Down Expand Up @@ -2622,6 +2632,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