Skip to content

Deprecate remaining UNSPECIFIED enum members#225

Merged
llucax merged 5 commits into
frequenz-floss:v0.x.xfrom
llucax:no-unspecified-phase-d
Jul 3, 2026
Merged

Deprecate remaining UNSPECIFIED enum members#225
llucax merged 5 commits into
frequenz-floss:v0.x.xfrom
llucax:no-unspecified-phase-d

Conversation

@llucax

@llucax llucax commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Deprecate ElectricalComponentDiagnosticCode.UNSPECIFIED, ElectricalComponentStateCode.UNSPECIFIED, and Event.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 UNSPECIFIED values in the future, and use the int 0 value instead if necessary.

Part of #223.

@github-actions github-actions Bot added part:docs Affects the documentation part:tests Affects the unit, integration and performance (benchmarks) tests part:tooling Affects the development tooling (CI, deployment, dependency management, etc.) part:grid Affects the grid protobuf definitions part:metrics Affects the metrics protobuf definitions part:microgrid Affects the microgrid protobuf definitions labels Jun 26, 2026
@llucax

This comment was marked as outdated.

@llucax
llucax force-pushed the no-unspecified-phase-d branch 5 times, most recently from bad811f to b1b2ee1 Compare July 1, 2026 09:57
llucax added 5 commits July 3, 2026 10:42
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 llucax self-assigned this Jul 3, 2026
@llucax llucax added this to the v0.4.1 milestone Jul 3, 2026
@llucax
llucax marked this pull request as ready for review July 3, 2026 08:44
@llucax
llucax requested a review from a team as a code owner July 3, 2026 08:44
@llucax
llucax requested review from a team, Marenz, daniel-zullo-frequenz and shsms and removed request for a team July 3, 2026 08:44
@llucax

This comment was marked as outdated.

@llucax
llucax enabled auto-merge July 3, 2026 08:45
@llucax
llucax force-pushed the no-unspecified-phase-d branch from b1b2ee1 to ec35e7e Compare July 3, 2026 08:45
@llucax
llucax added this pull request to the merge queue Jul 3, 2026
Merged via the queue into frequenz-floss:v0.x.x with commit dd974c2 Jul 3, 2026
9 checks passed
@llucax
llucax deleted the no-unspecified-phase-d branch July 3, 2026 09:04
@llucax llucax linked an issue Jul 3, 2026 that may be closed by this pull request
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

part:docs Affects the documentation part:grid Affects the grid protobuf definitions part:metrics Affects the metrics protobuf definitions part:microgrid Affects the microgrid protobuf definitions part:tests Affects the unit, integration and performance (benchmarks) tests part:tooling Affects the development tooling (CI, deployment, dependency management, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove all UNSPECIFIED enum values and low-level enums

2 participants