AP-25704: add inactive output support for Python nodes#92
Open
AP-25704: add inactive output support for Python nodes#92
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a first-class “inactive output” marker for Python-based KNIME nodes and wires it through the Python↔Java port conversion layer so nodes can explicitly mark specific output slots as inactive.
Changes:
- Add
knext.InactivePortsentinel and document its use inconfigure()/execute(). - Map the sentinel to/from KNIME’s
InactiveBranchPortObject/InactiveBranchPortObjectSpecin both the Python backend launcher and Java port type registry. - Add Python and Java tests covering spec/object conversion and proxy behavior while preserving output arity.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
org.knime.python3.nodes/src/main/python/knime/extension/nodes.py |
Adds InactivePort sentinel + API doc updates for returning inactive outputs. |
org.knime.python3.nodes/src/main/python/knime/extension/__init__.py |
Re-exports InactivePort on the public knime.extension surface. |
org.knime.python3.nodes/src/main/python/_node_backend_launcher.py |
Converts inactive specs/objects between Python marker and KNIME inactive port types (by class name). |
org.knime.python3.nodes/src/main/java/org/knime/python3/nodes/ports/PythonPortTypeRegistry.java |
Adds Java-side conversion shortcuts for inactive port object/spec. |
org.knime.python3.nodes/src/main/java/org/knime/python3/nodes/ports/PythonPortObjects.java |
Introduces Java-side Python wrapper singletons for inactive port object/spec. |
org.knime.python3.nodes.tests/src/test/python/unittest/test_knime_node_backend.py |
Adds unit tests for inactive conversions and proxy output arity. |
org.knime.python3.nodes.tests/src/test/java/org/knime/python3/nodes/ports/InactivePortConversionTest.java |
Adds Java unit tests for inactive conversions. |
cdb68f6 to
488e201
Compare
|
chaubold
requested changes
Apr 7, 2026
Contributor
chaubold
left a comment
There was a problem hiding this comment.
If I'm not mistaken then we can achieve the same thing on the Java side without additional if blocks in all the conversion methods, by registering a built-in converter, right?
org.knime.python3.nodes/src/main/java/org/knime/python3/nodes/ports/PythonPortTypeRegistry.java
Outdated
Show resolved
Hide resolved
org.knime.python3.nodes/src/main/java/org/knime/python3/nodes/ports/PythonPortTypeRegistry.java
Outdated
Show resolved
Hide resolved
org.knime.python3.nodes/src/main/java/org/knime/python3/nodes/ports/PythonPortTypeRegistry.java
Outdated
Show resolved
Hide resolved
488e201 to
bbbab46
Compare
The KNIME -> Python direction currently can't happen because the underlying DelegatingNodeModel does not implement the InactiveBranchConsumer interface.
bbbab46 to
adb77ce
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


No description provided.