Deprecate remaining UNSPECIFIED enum members#225
Merged
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
12 tasks
llucax
force-pushed
the
no-unspecified-phase-d
branch
5 times, most recently
from
July 1, 2026 09:57
bad811f to
b1b2ee1
Compare
Two import styles coexisted for `frequenz.core.enum`: some modules used `from frequenz.core import enum as core_enum` and qualified every symbol (`core_enum.unique`, `core_enum.Enum`, `core_enum.deprecated_member`), while `grid/_delivery_area.py` already used the direct named-import form `from frequenz.core.enum import Enum, deprecated_member, unique`. Switch the remaining consumers to the same named-import form so the codebase speaks a single style end-to-end. As a side effect, `metrics/_sample.py` no longer needs `import enum` because the stdlib `enum.unique`/`enum.Enum` used by `AggregationMethod` are now sourced from `frequenz.core.enum` along with everything else. This is a pure mechanical refactor: no enum member, value, decorator semantics, deprecation message string, or public symbol changes; only the import statement and the unqualified references it enables. No release note is needed since there is no public surface change. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
The `UNSPECIFIED` member is the zero / default protobuf enum value and is not a real diagnostic code. Mark it deprecated, so callers stop relying on it. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Mark `ElectricalComponentStateCode.UNSPECIFIED` as a deprecated member. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Mark `Event.UNSPECIFIED` as deprecated. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
llucax
marked this pull request as ready for review
July 3, 2026 08:44
llucax
requested review from
a team,
Marenz,
daniel-zullo-frequenz and
shsms
and removed request for
a team
July 3, 2026 08:44
This comment was marked as outdated.
This comment was marked as outdated.
llucax
enabled auto-merge
July 3, 2026 08:45
llucax
force-pushed
the
no-unspecified-phase-d
branch
from
July 3, 2026 08:45
b1b2ee1 to
ec35e7e
Compare
shsms
approved these changes
Jul 3, 2026
12 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Deprecate
ElectricalComponentDiagnosticCode.UNSPECIFIED,ElectricalComponentStateCode.UNSPECIFIED, andEvent.UNSPECIFIED.These enums didn't have any conversion functions yet, nor are used by any other code in this repository, so it is just a warning for downstream projects to adapt to not having the
UNSPECIFIEDvalues in the future, and use theint0value instead if necessary.Part of #223.