From 9bc210427a05621137b16002a25a5892e57e3c90 Mon Sep 17 00:00:00 2001 From: Bas Schoenmaeckers Date: Mon, 2 Dec 2024 14:51:57 +0100 Subject: [PATCH] fix deprecation warnings in `polars-plan` --- crates/polars-plan/src/dsl/python_udf.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/polars-plan/src/dsl/python_udf.rs b/crates/polars-plan/src/dsl/python_udf.rs index cd133ceb646e..cb7b834627a2 100644 --- a/crates/polars-plan/src/dsl/python_udf.rs +++ b/crates/polars-plan/src/dsl/python_udf.rs @@ -78,11 +78,11 @@ impl PythonUdfExpression { // Load UDF Python::with_gil(|py| { - let pickle = PyModule::import_bound(py, "pickle") + let pickle = PyModule::import(py, "pickle") .expect("unable to import 'pickle'") .getattr("loads") .unwrap(); - let arg = (PyBytes::new_bound(py, remainder),); + let arg = (PyBytes::new(py, remainder),); let python_function = pickle.call1(arg).map_err(from_pyerr)?; Ok(Arc::new(Self::new( python_function.into(), @@ -136,7 +136,7 @@ impl ColumnsUdf for PythonUdfExpression { Python::with_gil(|py| { // Try pickle to serialize the UDF, otherwise fall back to cloudpickle. - let pickle = PyModule::import_bound(py, "pickle") + let pickle = PyModule::import(py, "pickle") .expect("unable to import 'pickle'") .getattr("dumps") .unwrap(); @@ -144,7 +144,7 @@ impl ColumnsUdf for PythonUdfExpression { let (dumped, use_cloudpickle) = match pickle_result { Ok(dumped) => (dumped, false), Err(_) => { - let cloudpickle = PyModule::import_bound(py, "cloudpickle") + let cloudpickle = PyModule::import(py, "cloudpickle") .map_err(from_pyerr)? .getattr("dumps") .unwrap();