diff --git a/crates/polars-error/src/warning.rs b/crates/polars-error/src/warning.rs index ee774a928bb8..8971e5736fed 100644 --- a/crates/polars-error/src/warning.rs +++ b/crates/polars-error/src/warning.rs @@ -12,6 +12,7 @@ pub unsafe fn set_warning_function(function: WarningFunction) { } #[derive(Debug)] pub enum PolarsWarning { + Deprecation, UserWarning, CategoricalRemappingWarning, MapWithoutReturnDtypeWarning, diff --git a/crates/polars-plan/src/plans/optimizer/mod.rs b/crates/polars-plan/src/plans/optimizer/mod.rs index 19ea4e9c5317..1a16eb714127 100644 --- a/crates/polars-plan/src/plans/optimizer/mod.rs +++ b/crates/polars-plan/src/plans/optimizer/mod.rs @@ -70,6 +70,19 @@ pub fn optimize( #[allow(dead_code)] let verbose = verbose(); + if opt_state.streaming() { + polars_warn!( + Deprecation, + "\ +The old streaming engine is being deprecated and will soon be replaced by the new streaming \ +engine. Starting Polars version 1.23.0 and until the new streaming engine is released, the old \ +streaming engine may become less usable. For people who rely on the old streaming engine, it is \ +suggested to pin your version to before 1.23.0. + +More information on the new streaming engine: https://github.com/pola-rs/polars/issues/20947" + ) + } + // Gradually fill the rules passed to the optimizer let opt = StackOptimizer {}; let mut rules: Vec> = Vec::with_capacity(8); diff --git a/crates/polars-python/src/error.rs b/crates/polars-python/src/error.rs index 73e2629798b6..8b7b74393549 100644 --- a/crates/polars-python/src/error.rs +++ b/crates/polars-python/src/error.rs @@ -4,8 +4,8 @@ use std::io::{Error, ErrorKind}; use polars::prelude::PolarsError; use polars_error::PolarsWarning; use pyo3::exceptions::{ - PyFileExistsError, PyFileNotFoundError, PyIOError, PyPermissionError, PyRuntimeError, - PyUserWarning, + PyDeprecationWarning, PyFileExistsError, PyFileNotFoundError, PyIOError, PyPermissionError, + PyRuntimeError, PyUserWarning, }; use pyo3::prelude::*; use pyo3::PyTypeInfo; @@ -118,6 +118,7 @@ impl<'py> IntoPyObject<'py> for Wrap { Ok(MapWithoutReturnDtypeWarning::type_object(py).into_any()) }, PolarsWarning::UserWarning => Ok(PyUserWarning::type_object(py).into_any()), + PolarsWarning::Deprecation => Ok(PyDeprecationWarning::type_object(py).into_any()), } } } diff --git a/py-polars/pyproject.toml b/py-polars/pyproject.toml index 210acffcd442..cef4a2848754 100644 --- a/py-polars/pyproject.toml +++ b/py-polars/pyproject.toml @@ -261,6 +261,9 @@ filterwarnings = [ "ignore:Deprecated API features detected.*:DeprecationWarning", # numpy import can generate this warning in Python 3.13 on certain runners "ignore:.*numpy\\.longdouble.*:UserWarning", + # The old streaming engine is deprecated, until the new streaming engine is + # done just ignore the deprecation warnings. + "ignore:The old streaming engine*:DeprecationWarning", ] xfail_strict = true