Partition Tables Predicate

class node_filter_list.PartitionTablesPredicate[source]

Partition nodes with predicate takes a configurable predicate function (a function that returns True or False) from the configuration and uses it to decide how to partition the output.

The function is applied for each input element in the list when it returns True, then the element is written to the first output, otherwise it is written to the second output.

Examples (with table as the element type):

Remove tables with zero length columns:

lambda table: table.number_of_columns() > 0

Remove empty tables:

lambda table: not table.is_empty()

Partition a list of Tables using a predicate.

: [table]

Input data Tables

: [table]

Output data Tables where predicate returns True

: [table]

Output data Tables where predicate returns False

Predicate partition function

Partition function