diff --git a/Cargo.lock b/Cargo.lock index 109ab186..e5c95481 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1463,6 +1463,7 @@ dependencies = [ "eyre", "flume", "pyo3", + "pythonize", "serde_yaml 0.8.26", ] @@ -3694,6 +3695,16 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "pythonize" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a0e1bbcd2a3856284bf4f4ef09ccb1157e9467847792754556f153ea3fe6b42" +dependencies = [ + "pyo3", + "serde", +] + [[package]] name = "quick-xml" version = "0.28.2" diff --git a/apis/python/node/Cargo.toml b/apis/python/node/Cargo.toml index 8e92a8c9..ad676943 100644 --- a/apis/python/node/Cargo.toml +++ b/apis/python/node/Cargo.toml @@ -22,6 +22,7 @@ serde_yaml = "0.8.23" flume = "0.10.14" dora-runtime = { workspace = true, features = ["tracing", "python"] } arrow = { version = "35.0.0", features = ["pyarrow"] } +pythonize = "0.18.0" [lib] name = "dora" diff --git a/apis/python/node/src/lib.rs b/apis/python/node/src/lib.rs index 32c7012a..d8266344 100644 --- a/apis/python/node/src/lib.rs +++ b/apis/python/node/src/lib.rs @@ -83,6 +83,10 @@ impl Node { self.send_output_slice(output_id, data.len(), data, metadata) }) } + + pub fn dataflow_descriptor(&self, py: Python) -> pythonize::Result { + pythonize::pythonize(py, self.node.dataflow_descriptor()) + } } impl Node {