Restore ComponentId from v0.3.x - #287
Merged
Merged
Conversation
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
llucax
requested review from
florian-wagner-frequenz
and removed request for
a team
September 18, 2026 08:46
llucax
enabled auto-merge
September 18, 2026 08:46
shsms
approved these changes
Sep 18, 2026
Marenz
approved these changes
Sep 18, 2026
Marenz
left a comment
Contributor
There was a problem hiding this comment.
Verified locally: restored class is byte-identical to v0.3.8, the SDK's 68 ComponentId imports are the concrete consumer, full nox green.
llucax
added a commit
to llucax/frequenz-client-common-python
that referenced
this pull request
Sep 21, 2026
`ComponentId` (the deprecated v0.3.x compatibility class restored in frequenz-floss#287) and `ElectricalComponentId` both claimed the `str_prefix` "CID". Importing both triggered a `"Prefix 'CID' is already registered"` warning from `frequenz-core`'s `BaseId`, and two objects with the same numeric value would print identically (`CID42`) while comparing unequal and hashing differently, a subtle correctness hazard. The deprecated `ComponentId` keeps `CID` because that is its historical representation and changing it would defeat the compatibility it exists for. `ElectricalComponentId` moves to `ECID`. The prefix is output-only: `BaseId` uses it in `__str__` and the `str_prefix` property only. There is no parse-from-string path in `BaseId`, and IDs cross the wire as plain integers. This cannot break round-tripping, persistence or the protocol. The import-order test that previously asserted the duplicate prefix warning is updated to assert the warning is gone. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
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.
This type was removed too soon. v0.4.0 was released but not very widely adopted, so this problem was never detected. Removing the old
ComponentIdmeans no downstream project can have a working version that supports both v0.3.x and v0.4.x series, which complicates a clean non-breaking upgrade path.