Summary
src/a2a/utils/proto_utils.py currently uses the deprecated FieldDescriptor.label property to check whether a protobuf field is repeated. The non-deprecated alternative is FieldDescriptor.is_repeated, but adopting it requires a newer minimum version of protobuf than we currently declare, which would be a breaking change for downstream consumers.
Locations
All occurrences are in src/a2a/utils/proto_utils.py:
src/a2a/utils/proto_utils.py:177 — _populate_message_from_params (or similar)
src/a2a/utils/proto_utils.py:211 — _check_required_field_violation
src/a2a/utils/proto_utils.py:252 — _recurse_validation
Each site is marked with a TODO comment referencing this issue.
Proposed change
- Bump the minimum required
protobuf version in pyproject.toml to one that exposes FieldDescriptor.is_repeated as a stable, non-deprecated API.
- Replace all
field.label == FieldDescriptor.LABEL_REPEATED checks with field.is_repeated.
- Replace all
field.label != FieldDescriptor.LABEL_REPEATED checks with not field.is_repeated.
- Remove the
TODO comments and unused LABEL_REPEATED import if no longer needed.
- Schedule the change as part of the next breaking release.
Summary
src/a2a/utils/proto_utils.pycurrently uses the deprecatedFieldDescriptor.labelproperty to check whether a protobuf field is repeated. The non-deprecated alternative isFieldDescriptor.is_repeated, but adopting it requires a newer minimum version ofprotobufthan we currently declare, which would be a breaking change for downstream consumers.Locations
All occurrences are in
src/a2a/utils/proto_utils.py:src/a2a/utils/proto_utils.py:177—_populate_message_from_params(or similar)src/a2a/utils/proto_utils.py:211—_check_required_field_violationsrc/a2a/utils/proto_utils.py:252—_recurse_validationEach site is marked with a
TODOcomment referencing this issue.Proposed change
protobufversion inpyproject.tomlto one that exposesFieldDescriptor.is_repeatedas a stable, non-deprecated API.field.label == FieldDescriptor.LABEL_REPEATEDchecks withfield.is_repeated.field.label != FieldDescriptor.LABEL_REPEATEDchecks withnot field.is_repeated.TODOcomments and unusedLABEL_REPEATEDimport if no longer needed.