Feature suggestion: option to skip loop if input table has zero rows

Dear Knimers,

My suggestion is to add an option to most loop start nodes for skipping the loop if the input table has 0 rows. For example, the “Chunk Loop Start” node runs once even when the input has no rows. This is different behavior than for example in Python/Pandas, when a for loop with “df.iterrows()” is not executed when df has no rows.

Often the nodes inside of the loop will not be able to handle a zero-row table, in that case it would be better to skip the loop entirely. This can be useful if the loop is nested in another loop; the “Loop End” node of that outer loop could then be configured with “Ignore Empty input tables” and the whole will run without a problem with no ugly “Empty Table Switches” necessary.

Best
Aswin

That’s a pretty clever idea!

1 Like