Skip to content

AP-25704: add inactive output support for Python nodes#92

Open
AtR1an wants to merge 2 commits intomasterfrom
enh/AP-25704-inactive-ports
Open

AP-25704: add inactive output support for Python nodes#92
AtR1an wants to merge 2 commits intomasterfrom
enh/AP-25704-inactive-ports

Conversation

@AtR1an
Copy link
Copy Markdown
Contributor

@AtR1an AtR1an commented Mar 20, 2026

No description provided.

@AtR1an AtR1an requested a review from a team as a code owner March 20, 2026 10:10
@AtR1an AtR1an requested review from Copilot and knime-ghub-bot and removed request for a team March 20, 2026 10:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.InactivePort sentinel and document its use in configure()/execute().
  • Map the sentinel to/from KNIME’s InactiveBranchPortObject / InactiveBranchPortObjectSpec in 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.

@AtR1an AtR1an force-pushed the enh/AP-25704-inactive-ports branch from cdb68f6 to 488e201 Compare March 20, 2026 11:12
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
83.3% Coverage on New Code (required ≥ 85%)

See analysis details on SonarQube Cloud

Copy link
Copy Markdown
Contributor

@chaubold chaubold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@AtR1an AtR1an force-pushed the enh/AP-25704-inactive-ports branch from 488e201 to bbbab46 Compare April 10, 2026 14:17
The KNIME -> Python direction currently can't happen because the
underlying DelegatingNodeModel does not implement the
InactiveBranchConsumer interface.
@AtR1an AtR1an force-pushed the enh/AP-25704-inactive-ports branch from bbbab46 to adb77ce Compare April 10, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants