feat: add decoded_properties method to ServiceInfo#1332
Merged
Conversation
Clean up the typing on ServiceInfo.properties to always return bytes. The typing on properties was very confusing because it could have a mix of bytes and str types, but only bytes would ever come back from the backend and cache. The only way str could happen is if someone manually passed it in. We now ensure all passed in data is converted to bytes
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1332 +/- ##
=======================================
Coverage 99.77% 99.77%
=======================================
Files 30 30
Lines 3143 3164 +21
Branches 524 528 +4
=======================================
+ Hits 3136 3157 +21
Misses 5 5
Partials 2 2 ☔ View full report in Codecov by Sentry. |
bdraco
commented
Dec 13, 2023
openstack-mirroring
pushed a commit
to openstack/openstack
that referenced
this pull request
Jan 5, 2024
* Update ironic-lib from branch 'master'
to 523407eebf22b68a3b1a3926666e8bb24fedf871
- Merge "Compatibility with zeroconf 0.129.0"
- Compatibility with zeroconf 0.129.0
From Zeroconf CHANGELOG.md:
v0.129.0 (2023-12-13)
Feature
* Add decoded_properties method to ServiceInfo
python-zeroconf/python-zeroconf#1332
python-zeroconf/python-zeroconf@9b595a1
* Ensure ServiceInfo.properties always returns bytes
python-zeroconf/python-zeroconf#1333
python-zeroconf/python-zeroconf@d29553a
Technically breaking change
* `ServiceInfo.properties` always returns a dictionary with type
`dict[bytes, bytes | None]` instead of a mix `str` and `bytes`. It was
only possible to get a mixed dictionary if it was manually passed in
when `ServiceInfo` was constructed.
Co-Authored-By: Dmitry Tantsur <dtantsur@protonmail.com>
Change-Id: I7f1a0c3329e5f29ec3e274558e3681142cc2ef78
openstack-mirroring
pushed a commit
to openstack/ironic-lib
that referenced
this pull request
Jan 5, 2024
From Zeroconf CHANGELOG.md: v0.129.0 (2023-12-13) Feature * Add decoded_properties method to ServiceInfo python-zeroconf/python-zeroconf#1332 python-zeroconf/python-zeroconf@9b595a1 * Ensure ServiceInfo.properties always returns bytes python-zeroconf/python-zeroconf#1333 python-zeroconf/python-zeroconf@d29553a Technically breaking change * `ServiceInfo.properties` always returns a dictionary with type `dict[bytes, bytes | None]` instead of a mix `str` and `bytes`. It was only possible to get a mixed dictionary if it was manually passed in when `ServiceInfo` was constructed. Co-Authored-By: Dmitry Tantsur <dtantsur@protonmail.com> Change-Id: I7f1a0c3329e5f29ec3e274558e3681142cc2ef78
5 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.
ServiceInfo.decoded_propertiesis now available which returns astrrepresentation of the properties instead ofbytes