Skip to content

It is surprising that None-valued entries are silently dropped #779

Description

@elinscott

aiida-workgraph treats None as "unset" rather than as a legitimate value. This gave rise to a couple of surprises.

First, any Optional[T] parameter without a = None default raises TypeError: missing 1 required keyword-only argument even when it has been provided by the caller. (Not especially critical, because typically such parameters come with None as a default)

Second, a dict-typed socket carrying {"k": None} arrives at the receiver as {} — the key is dropped silently, so downstream payload["k"] raises KeyError. More critical than the first case, because this entry won't be re-populated via defaults.

Is there any reason why None should be stripped rather than retained?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions