Hi fellow KNIMErs,
I am currently exploring the Python API of KAP v4.7 to convert a set of components into a full-fledged Python extension.
One of the nodes that I intend to create requires the option to dynamically add and remove table input ports in KAP – think the dynamic ports functionality of standard nodes like the Excel Writer.
I take it from the documentation, however, that each input port must be defined with a @knext.input_table decorator.
I faced the same limitation when I built the components that I now want to bring into an extension. My workaround then was to have the user do a bit of preprocessing upstream: append an identifier column to all input tables and concatenate them. This data was fed to the component via a single table input port and then split internally by the identifier column again.
While I could implement this logic in the Python node’s execute method too, I would of course prefer to have actual dynamic input ports.
So, here go my questions:
- How can dynamic ports be achieved with the Python API?
- If it is not feasible at the moment, where is it on the roadmap?
Any comments and pointers will be appreciated!
Cheers