Skip to content

fix: replace deprecated FieldDescriptor.label with is_repeated in proto_utils - #1158

Open
Linux2010 wants to merge 2 commits into
a2aproject:mainfrom
Linux2010:fix/1011-proto-utils-is-repeated-v2
Open

fix: replace deprecated FieldDescriptor.label with is_repeated in proto_utils#1158
Linux2010 wants to merge 2 commits into
a2aproject:mainfrom
Linux2010:fix/1011-proto-utils-is-repeated-v2

Conversation

@Linux2010

Copy link
Copy Markdown
Contributor

Summary

Closes #1011

Replaces the deprecated FieldDescriptor.label property with the non-deprecated FieldDescriptor.is_repeated attribute in src/a2a/utils/proto_utils.py.

Changes

  • src/a2a/utils/proto_utils.py: Replace all 3 occurrences of field.label == FieldDescriptor.LABEL_REPEATED / field.label != FieldDescriptor.LABEL_REPEATED with field.is_repeated / not field.is_repeated
  • Remove the unused LABEL_REPEATED import
  • Remove the 3 TODO comments referencing [Task]: Replace deprecated FieldDescriptor.label with is_repeated in proto_utils #1011
  • tests/utils/test_proto_utils.py: Add test for repeated nested message validation

Verification

  • is_repeated is available in the current minimum protobuf>=5.29.5
  • All existing proto_utils tests pass (14 passed)
  • Lint passes (./scripts/lint.sh)

Linux2010 and others added 2 commits August 2, 2026 23:43
…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>
@Linux2010
Linux2010 requested a review from a team as a code owner August 2, 2026 15:44
@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown

🧪 Code Coverage (vs main)

⬇️ Download Full Report

No coverage changes.

Generated by coverage-comment.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Task]: Replace deprecated FieldDescriptor.label with is_repeated in proto_utils

1 participant