Does Python Script node only work with an input table connected?

Recently I downloaded a workflow containg two legacy Python nodes which are not very complex. Because of that I thought I should try replacing them with the current Python nodes to learn how they work. In the original workflow the legacy Python nodes didn’t use any input table and only process flow variables, so I thought I’d do the same. For quite some time I couldn’t figure out why my Python node wouldn’t work and would no show any flow variables on the left side. Until I connected an empty Table Creator and everything is fine.

Is this behavior intended? Did I overlook some part of the documentation or node description? It’s not a huge issue, it just looks funny.

Hi @mika_lehmann,

thanks for sharing the thinking process.
How to port scripts from legacy nodes to the current ones is described in the section Porting Scripts from the Python Script (Legacy) Nodes here: KNIME Python Integration Guide

But I guess, this you worked out already.

The new Python Script node works with dynamic ports - see the end of the following chapter: KNIME Python Integration Guide

It says that you can, for example, remove the input table port (see screenshot below). Once you align the ports of your new node to the legacy node (and port the script - see my first paragraph), then it should work.

@mika_lehmann, please let me know whether that works and I am also happy about suggestions how we can improve it (node or documentation) to make that clearer.

Best regards
Steffen

2 Likes

Thank you very much. I think I found the reason: The three dots are visible in the classic view, but not in the modern UI. Since I started with KNIME 5.1 I rarely use the classic UI. You could add that to the documentation until it’s included in the modern UI.

Hi @mika_lehmann,

oh. You are correct: it seems currently not possible in the Modern UI. I will adjust that part in the docs in the coming weeks. Thanks!

Steffen

1 Like

Hi @mika_lehmann,

I was wrong: if you click on the input port itself, a trash can symbol appears which lets you delete the port.

This will find its way into the docs.

Screenshot 2023-08-17 at 16.54.53

Steffen

4 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.