Browse Source

Make dataflow descriptor available to Python nodes

tags/v0.2.4-rc
Philipp Oppermann 2 years ago
parent
commit
07689b9404
Failed to extract signature
3 changed files with 16 additions and 0 deletions
  1. +11
    -0
      Cargo.lock
  2. +1
    -0
      apis/python/node/Cargo.toml
  3. +4
    -0
      apis/python/node/src/lib.rs

+ 11
- 0
Cargo.lock View File

@@ -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"


+ 1
- 0
apis/python/node/Cargo.toml View File

@@ -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"


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

@@ -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<PyObject> {
pythonize::pythonize(py, self.node.dataflow_descriptor())
}
}

impl Node {


Loading…
Cancel
Save