Feature request: for the Ungroup node, provide option for removing rows with empty collections

#1

Dear Knimers,

When ungrouping a row containing a Collection with 3 elements, I get 3 rows.
When ungrouping a row containing a Collection with 2 elements, I get 2 rows.
When ungrouping a row containing a Collection with 1 element, I get 1 row.
When ungrouping a row containing a Collection with 0 elements, I get… 1 row, with a missing value.

In some situations this is inconsistent behaviour. Yes I could remove the missing value row with a Row Filter or a Missing Value node, but then what about non-empty collections containing missing value elements? Therefore I suggest adding an option to the “Ungroup” node to remove rows with empty collections.

Best,
Aswin

0 Likes

#2

Hi @Aswin -

Unless I’m missing something obvious - which is entirely possible - isn’t this case already handled by the Skip missing values checkbox in the Ungroup node? See attached workflow:

Ungroup_missings_example.knwf (9.3 KB)

0 Likes

#3

Hi @ScottF

I was not referring to a Missing Value cell in a Collection column, I was referring to an empty Collection; i.e. a Collection with no elements. An empty Collection is not the same thing as a Missing Value. For example:
image

When I try to ungroup this, this happens (“Skip missing values” checkbox has no influence here):
image

The list with 1 element and the list with zero elements both yield 1 row in the final table. I think for the empty list zero rows would be make more sense in many cases.

“Now”, I hear you ask, “since the row that came from the empty list now contains a missing value, you can simply remove that row with a Row Filter or Missing Value node.” Yes, but what if some of the lists contain missing values that I want to keep? Extreme example:
image

Ungroup:
image

The Row Filter trick will not work here. (Amusing: when I check the “Skip missing value” checkbox here, I only get a single row from the Ungroup node: the line from the empty list, containing a Missing Value :smile: )

“A situation where this is a problem will be rare” one might think. Look at the following table where the two neighboring lists are “synchronized”; the lists are equally long and the elements match pairwise. This makes the missing values in the list very important:
image

Ungroup:
image

Best,
Aswin

KNIME_project2.knwf (13.5 KB)

1 Like

#4

Hi there @Aswin,

tnx for detailed explanation. Ticket is created.

Br,
Ivan

2 Likes

#5

Thanks Ivan!

(Also, reading through Aswin’s example, I had a good chuckle at “Friendzone Unlimited” :smile: )

2 Likes

#6

With a name like that, it is no surprise that their customer Collections have zero elements :nerd_face:

0 Likes