Browse Source

Remove bound from definition of .to_py_dict

tags/v0.3.5-rc0
haixuanTao 1 year ago
parent
commit
c4263e6c8f
3 changed files with 4 additions and 4 deletions
  1. +2
    -2
      apis/python/node/src/lib.rs
  2. +1
    -1
      apis/python/operator/src/lib.rs
  3. +1
    -1
      binaries/runtime/src/operator/python.rs

+ 2
- 2
apis/python/node/src/lib.rs View File

@@ -74,7 +74,7 @@ impl Node {
let event = py.allow_threads(|| self.events.recv(timeout.map(Duration::from_secs_f32)));
if let Some(event) = event {
let dict = event
.to_py_dict_bound(py)
.to_py_dict(py)
.context("Could not convert event into a dict")?;
Ok(Some(dict))
} else {
@@ -96,7 +96,7 @@ impl Node {
///
/// :rtype: dict
pub fn __next__(&mut self, py: Python) -> PyResult<Option<Py<PyDict>>> {
self.next(py, Some(2.0))
self.next(py, None)
}

/// You can iterate over the event stream with a loop


+ 1
- 1
apis/python/operator/src/lib.rs View File

@@ -16,7 +16,7 @@ pub struct PyEvent {
}

impl PyEvent {
pub fn to_py_dict_bound(self, py: Python<'_>) -> PyResult<Py<PyDict>> {
pub fn to_py_dict(self, py: Python<'_>) -> PyResult<Py<PyDict>> {
let mut pydict = HashMap::new();
match &self.event {
MergedEvent::Dora(_) => pydict.insert("kind", "dora".to_object(py)),


+ 1
- 1
binaries/runtime/src/operator/python.rs View File

@@ -209,7 +209,7 @@ pub fn run(
}

let py_event = PyEvent::from(event)
.to_py_dict_bound(py)
.to_py_dict(py)
.context("Could not convert event to pydict bound")?;

let status_enum = operator


Loading…
Cancel
Save