From 7e709fb86145b5def8da7ed9fa9dbf87711ad695 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Fri, 5 Jun 2026 15:40:13 -0500 Subject: [PATCH] Fix tricky Rust error which turned out to just needing to use an actual `py` ``` error[E0277]: the trait bound `std::vec::Vec: pyo3::FromPyObject<'_, '_>` is not satisfied --> rust/src/storage/db/python_db_pool.rs:228:30 | 228 | Ok(fetch_fn.call0()?.extract()?) | ^^^^^^^ the trait `pyo3::FromPyObject<'_, '_>` is not implemented for `std::vec::Vec` | note: required by a bound in `pyo3::types::PyAnyMethods::extract` --> /home/eric/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/pyo3-0.28.3/src/types/any.rs:881:12 | 879 | fn extract<'a, T>(&'a self) -> Result | ------- required by a bound in this associated function 880 | where 881 | T: FromPyObject<'a, 'py>; | ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `PyAnyMethods::extract` help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement | 223 | ) -> anyhow::Result> where std::vec::Vec: pyo3::FromPyObject<'_, '_> { | ++++++++++++++++++++++++++++++++++++++++++++++++++ ``` --- rust/src/storage/db/python_db_pool.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/src/storage/db/python_db_pool.rs b/rust/src/storage/db/python_db_pool.rs index 2c4bb4f237..d7387ccb63 100644 --- a/rust/src/storage/db/python_db_pool.rs +++ b/rust/src/storage/db/python_db_pool.rs @@ -224,7 +224,7 @@ impl LoggingTransactionWrapper { let fetch_fn = self .logging_transaction_py .bind(py) - .getattr(intern!(self.logging_transaction_py.py(), "fetchall"))?; + .getattr(intern!(py, "fetchall"))?; Ok(fetch_fn.call0()?.extract()?) } }