This is an automated email from the ASF dual-hosted git repository. yuxia pushed a commit to branch support-database-level-ops in repository https://gitbox.apache.org/repos/asf/fluss-rust.git
commit 391e66ee91e81919d48c80dc3049a1ad26ebc56d Author: luoyuxia <[email protected]> AuthorDate: Sun Feb 8 12:31:34 2026 +0800 address comments --- bindings/python/src/admin.rs | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/bindings/python/src/admin.rs b/bindings/python/src/admin.rs index 8abf761..335aa24 100644 --- a/bindings/python/src/admin.rs +++ b/bindings/python/src/admin.rs @@ -17,6 +17,7 @@ use crate::*; use fcore::rpc::message::OffsetSpec; +use pyo3::conversion::IntoPyObject; use pyo3_async_runtimes::tokio::future_into_py; use std::sync::Arc; @@ -161,15 +162,7 @@ impl FlussAdmin { FlussError::new_err(format!("Failed to check database exists: {e}")) })?; - Python::attach(|py| { - let builtins = py.import("builtins")?; - let val = if exists { - builtins.getattr("True")? - } else { - builtins.getattr("False")? - }; - Ok(val.unbind()) - }) + Python::attach(|py| Ok(exists.into_pyobject(py)?.to_owned().into_any().unbind())) }) } @@ -250,15 +243,7 @@ impl FlussAdmin { .await .map_err(|e| FlussError::new_err(format!("Failed to check table exists: {e}")))?; - Python::attach(|py| { - let builtins = py.import("builtins")?; - let val = if exists { - builtins.getattr("True")? - } else { - builtins.getattr("False")? - }; - Ok(val.unbind()) - }) + Python::attach(|py| Ok(exists.into_pyobject(py)?.to_owned().into_any().unbind())) }) }
