Hi,
I have a very basic question. I have a (java based) node which will create a new column. The user can provide the name of the new column via TextInputWidget. I added the column name validation pattern which will show a red “warning” if the input field is empty.
@TextInputWidget(patternValidation = ColumnNameValidationUtils.ColumnNameValidation.class )
Still, the user can apply and execute the node.
When creating the column rearranger, I provided the setup for the new column like this:
final var uniqueNameGenerator = new UniqueNameGenerator(spec);
DataColumnSpec cspec = uniqueNameGenerator.newColumn(outputColumnName, outType);
If the new column name is an empty string, I will get a new column named <empty_1>.
First, I am confused that the number within that column name varies when changing/applying the settings several times. (looks like a bug to me)
Second, I was wondering whether it would be good practice to avoid these cases (by checking for an empty string and throwing an InvalidSettingsException) or if there is any scenario when these names are valid.
I can provide the full code of this node if that helps.
Antje