Browse Source

Remove error status for Python in favor of native Python errors

tags/v0.0.0-test.4
Philipp Oppermann 3 years ago
parent
commit
128922ac65
Failed to extract signature
3 changed files with 2 additions and 5 deletions
  1. +2
    -3
      binaries/runtime/src/operator/python.rs
  2. +0
    -1
      examples/python-operator/op.py
  3. +0
    -1
      examples/python-operator/op2.py

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

@@ -79,9 +79,8 @@ pub fn spawn(
let status: i32 = Python::with_gil(|py| status_val.extract(py))
.wrap_err("on_input has invalid return value")?;
match status {
0 => {} // ok
1 => break, // stop
-1 => bail!("on_input returned an error"), // err
0 => {} // ok
1 => break, // stop
other => bail!("on_input returned invalid status {other}"),
}
}


+ 0
- 1
examples/python-operator/op.py View File

@@ -3,7 +3,6 @@ from enum import Enum

class DoraStatus(Enum):
CONTINUE = 0
ERR = -1
STOP = 1

class Operator:


+ 0
- 1
examples/python-operator/op2.py View File

@@ -3,7 +3,6 @@ from enum import Enum

class DoraStatus(Enum):
OK = 0
ERR = -1
STOP = 1

class Operator:


Loading…
Cancel
Save