How to call set_progress correctly
I am using KNIME version 5.2.1 which runs on Mac OS. I am trying to add a progress indicator to a Python node with a long runtime. After some tinkering, I managed to set up a Conda environment that allows me to import Knime.extension.
However, I was not able to use the “set_progress” function correctly.
Here are my attempts:
import knime.extension as knext
...
# Convert the input table to a pandas DataFrame
input_table: DataFrame = knio.input_tables[0].to_pandas()
...
# Iterate over rows and make API calls
for i, (index, row) in enumerate(input_table.iterrows(), 1):
# Update progress
# knext.set_progress(i / len(input_table)) ??? even tried
# knext.ExecutionContext.set_progress(1.0) ???
...I would be grateful for any advice on how to solve this seemingly simple problem.