Skip to content

Commit

Permalink
chore: Deprecate the old streaming engine (#20949)
Browse files Browse the repository at this point in the history
  • Loading branch information
coastalwhite authored Jan 29, 2025
1 parent 8e1f9c4 commit ac6960c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions crates/polars-error/src/warning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pub unsafe fn set_warning_function(function: WarningFunction) {
}
#[derive(Debug)]
pub enum PolarsWarning {
Deprecation,
UserWarning,
CategoricalRemappingWarning,
MapWithoutReturnDtypeWarning,
Expand Down
13 changes: 13 additions & 0 deletions crates/polars-plan/src/plans/optimizer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Box<dyn OptimizationRule>> = Vec::with_capacity(8);
Expand Down
5 changes: 3 additions & 2 deletions crates/polars-python/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -118,6 +118,7 @@ impl<'py> IntoPyObject<'py> for Wrap<PolarsWarning> {
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()),
}
}
}
3 changes: 3 additions & 0 deletions py-polars/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit ac6960c

Please sign in to comment.