fix: replace deprecated FieldDescriptor.label with is_repeated in proto_utils - #1158
Open
Linux2010 wants to merge 2 commits into
Open
fix: replace deprecated FieldDescriptor.label with is_repeated in proto_utils#1158Linux2010 wants to merge 2 commits into
Linux2010 wants to merge 2 commits into
Conversation
…to_utils Use the non-deprecated FieldDescriptor.is_repeated property instead of comparing field.label to LABEL_REPEATED. Remove all TODO comments referencing issue a2aproject#1011. Closes a2aproject#1011 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Covers the _recurse_validation path for repeated message fields (e.g. Task.history), which was not previously tested. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
🧪 Code Coverage (vs
|
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.
Summary
Closes #1011
Replaces the deprecated
FieldDescriptor.labelproperty with the non-deprecatedFieldDescriptor.is_repeatedattribute insrc/a2a/utils/proto_utils.py.Changes
src/a2a/utils/proto_utils.py: Replace all 3 occurrences offield.label == FieldDescriptor.LABEL_REPEATED/field.label != FieldDescriptor.LABEL_REPEATEDwithfield.is_repeated/not field.is_repeatedLABEL_REPEATEDimportFieldDescriptor.labelwithis_repeatedinproto_utils#1011tests/utils/test_proto_utils.py: Add test for repeated nested message validationVerification
is_repeatedis available in the current minimumprotobuf>=5.29.5./scripts/lint.sh)