Original issue reported in aiida-common-workflows:
Consider the following example of a simple port that is not required and expects a string:
In [1]: from plumpy import InputPort
In [3]: port = InputPort('test', valid_type=str, required=False)
In [4]: port.validate('string')
In [5]: port.validate(None)
Out[5]: plumpy.ports.PortValidationError("Error occurred validating port 'test': value 'test' is not of the right type. Got '<class 'NoneType'>', expected '<class 'str'>'")
When we validate None as a value, we hit the validation error, just as in the EOS workchain. Except that None should be a perfectly legal value if the port is optional. It seems weird to raise for this. The only reason I can think off to keep the current behavior is that it might be necessary to have an optional port but where an explicit None value is incorrect and so if None is passed explicitly (instead of the input being omitted entirely) you want the port to raise. But I am wondering if this is not an edge-case and in that case the develop should simply explicitly check for None in a validator or the process body and ignore it.