Python Snippet node problem since update


I have just updated our version of KNIME server to KNIME 2.11.2.  I am now finding that the installed version of the python snippet node ( appears to be causing previously written workflows to fail.  These were running fine under our previous KNIME server (2.10.4) - where I checked the version of the python scripting extension was


Here is an example of the errors I see with the nodes now:

2015-03-11 09:00:11,607 ERROR KNIME-Worker-15 Python Snippet : Execute failed: ("ArrayIndexOutOfBoundsException"): 2
2015-03-11 09:00:11,608 DEBUG KNIME-Worker-15 Python Snippet : Execute failed: ("ArrayIndexOutOfBoundsException"): 2
java.lang.ArrayIndexOutOfBoundsException: 2
    at de.mpicbg.knime.scripting.python.PythonTableConverter.convertCSVToTable(
    at de.mpicbg.knime.scripting.python.PythonSnippetNodeModel.execute(
    at org.knime.core.node.NodeModel.execute(
    at org.knime.core.node.NodeModel.executeModel(
    at org.knime.core.node.Node.invokeFullyNodeModelExecute(
    at org.knime.core.node.Node.execute(
    at org.knime.core.node.workflow.NativeNodeContainer.performExecuteNode(
    at org.knime.core.node.exec.LocalNodeExecutionJob.mainExecute(
    at org.knime.core.node.workflow.NodeExecutionJob.internalRun(
    at org.knime.core.util.ThreadUtils$RunnableWithContextImpl.runWithContext(
    at org.knime.core.util.ThreadUtils$
    at java.util.concurrent.Executors$ Source)
    at Source)
    at org.knime.core.util.ThreadPool$
    at org.knime.core.util.ThreadPool$
2015-03-11 09:00:11,608 DEBUG KNIME-Worker-15 WorkflowManager : Python Snippet 0:304 doBeforePostExecution
2015-03-11 09:00:11,608 DEBUG KNIME-Worker-15 NodeContainer : Python Snippet 0:304 has new state: POSTEXECUTE
2015-03-11 09:00:11,608 DEBUG KNIME-Worker-15 WorkflowManager : Python Snippet 0:304 doAfterExecute - failure

If I paste the code into one of the 'new' Python Script nodes (and modify slightly to fit the new model - eg 'input_table' vs 'kIn', etc) the node runs fine.  However, it would be really useful to not have to do this for all of our legacy workflows in one go(!) - so I wondered if there is a chance an update could fix the issue?


Kind regards




does the error also occur with fresh nodes (no fancy script, just passing the data)?

if no, would it be somehow possible to get a small workflow which shows that error?


No - the error doesn't occur with a 'blank' python snippet cell.  I think I have figured-out what the problem is, though - and I expect you will be able to reproduce it with the following sort of snippet:


pyOut = kIn

output = []
for row in kIn['input']:

pyOut['output'] = output


So - it seems that newline characters (and possibly other escaped characters?) are now being handled differently...

Kind regards


I can reproduce the problem with your example. Indeed, it's the line break causing the problem.
Though my error message is different than the one you posted:

ERROR	 Python Snippet                	 Execute failed: unsupported string found in CSV:test"

I will look into that problem and try to fix it.

Thanks a lot for reporting the issue!



I am experiencing similar problems with Python snippets in Knime.  Code that was working in version 2.10.x does not always seem to work in 2.11.3  I am getting the "unsupported string found in CSV:" errors for data with a \n within a cell as well as columns that are typed at INT where there are missing (?) values.  None of this was a problem with the earlier versions.

Has there been any progress in solving this problem?  It's made many of my older workflows worthless with the latest Knime version. I'd simply roll back and wait out for a version that's stable with Python, but alas, this is not a viable long-term solution.

@jeshleman :

I'm sorry that your snippets do not work anymore. I've made changes at the transfer KNIME > Python to solve other issues. I could solve them but these changes introduced other issues (missing values for INT). I still need to look into the '\n' issue (sorry - I forgot to put it into the issue tracker...).

There are plans to implement major changes to provide a more solid solution.