Issues with the KNIME Python Library

Hello, I hope this is the right place to put this.
I have a workflow that I am attempting to get python to run basically following the tutorial located here.
I can get somethings to work but I have run into a few issues and I haven’t been able to find a lot of information regarding the library itself and I haven’t found a solution going through the documentation.
The first issue is that my nodes don’t seem to reset before running. For example, I have my code looking like this:

with knime.Workflow(workflow_path = workflow, workspace_path = workspace) as wf:
wf.save_after_execution = True
df = wf.data_table_outputs[0]

Edit I don’t know how to format the above properly but rest assured that in my code it is formatted properly.

In my workflow, I have a datetime generator so I can see when the code ran. This seems to just give me the last time I ran and saved it in KNIME itself. It I reset all the nodes before execution, I can get this to update but otherwise no luck.
Is there another argument I can put inside the with statement that will allow me to reset all nodes before executing?

The second issue I have is with some of my database connections. If they are reset before I run the python code, nothing runs. I get an error along the lines of “the node changed from Idle to Configured.” Is there a limitation on running workflows with database connections through Python?

Thanks in advanced, If I didn’t put this in the right spot please let me know where I should put these questions.

For the first question about the nodes not being reset, I think I see what would have to be changed in the code for the library to enable this feature.

Link to GitHub
Within the code there is a function called run_workflow_using_multiple_service_tables with a series of inputs. There would need to be another argument of the function that would be called something like reset and would take a true or false value.
Then in the shell command variable, the following line could be added after the save_after_execution line on line 247:
“” if not reset else “-reset”,
I think that would be all the program needs but I am not totally sure.

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