| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Change the type of `Microgrid.name` from `str | None` to `str`. Represent the absence of a name as `""` (matching the protobuf default) rather than `None`, so consumers don't have to distinguish between "no name" and "empty name" — the two are semantically identical. `microgrid_from_proto` now assigns `message.name` directly since protobuf string fields default to `""` when unset. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Now that `Microgrid.name` is `str` and represents the absence of a name as `""`, having no name is not an issue worth flagging. Drop the `minor_issues` bookkeeping in `microgrid_from_proto` (it was only used for the empty-name case) and the accompanying DEBUG log. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Change the type of `ElectricalComponent.name` from `str | None` to `str`. Represent the absence of a name as `""` (matching the protobuf default) rather than `None`, so consumers don't have to distinguish between "no name" and "empty name" — the two are semantically identical. The intermediate `_ElectricalComponentBaseData.name` and the proto conversion helpers are updated to match; tests that constructed concrete components without a name now pass `name=""` explicitly. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Now that `ElectricalComponent.name` is `str` and represents the absence of a name as `""`, having no name is not an issue worth flagging. Drop the `name is empty` minor issue in `_electrical_component_base_from_proto_with_issues` and inline `message.name` in the resulting `_ElectricalComponentBaseData`. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
…quenz-floss#272) This PR deprecates and removes all the remaining instances of `_with_issues()` functions, that should now have an anternative that reports issues via the type system. This should finalize frequenz-floss#238 for the v0.4.1 release.
| Back | FazBrowse Home | New Git URL |
Both Microgrid.name and ElectricalComponent.name were typed str | None, forcing consumers to distinguish between "no name" and an empty name — semantically identical states, since the underlying protobuf name fields default to "" when unset.
Change both to str and represent the absence of a name as "" (matching the protobuf default). As a consequence, the name is empty minor issue reported by microgrid_from_proto and _electrical_component_base_from_proto_with_issues is no longer meaningful — being unnamed is now valid rather than an issue worth flagging — so it is removed.
Part of #239.