Skip to content

tests: resolve failure related to unpacking dictionary for protobuf messages#17273

Merged
parthea merged 5 commits into
mainfrom
fragment-test
May 27, 2026
Merged

tests: resolve failure related to unpacking dictionary for protobuf messages#17273
parthea merged 5 commits into
mainfrom
fragment-test

Conversation

@parthea
Copy link
Copy Markdown
Contributor

@parthea parthea commented May 27, 2026

This PR resolves the following failure in #17245 (build log)

==================================== ERRORS ====================================
_ ERROR collecting tests/unit/gapic/bigtable_admin_v2/test_bigtable_instance_admin.py _
tests/unit/gapic/bigtable_admin_v2/test_bigtable_instance_admin.py:7259: in <module>
    iam_policy_pb2.GetIamPolicyRequest({}),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E   TypeError: _AddInitMethod.<locals>.init() takes 1 positional argument but 2 were given
_ ERROR collecting tests/unit/gapic/bigtable_admin_v2/test_bigtable_table_admin.py _
tests/unit/gapic/bigtable_admin_v2/test_bigtable_table_admin.py:11222: in <module>
    iam_policy_pb2.GetIamPolicyRequest({}),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E   TypeError: _AddInitMethod.<locals>.init() takes 1 positional argument but 2 were given

To resolve the issue, this PR adds ** to unpack fields as keyword arguments, maintaining compatibility with both proto-plus and pure protobuf messages.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces two new protocol buffer fragment files for testing: locations.proto, which defines a standard Locations service with its request and response messages, and test_protobuf_type.proto, which defines a MockLocationService utilizing the types from locations.proto. There are no review comments, so I have no feedback to provide.

@parthea parthea changed the title for testing purposes tests: resolve failure related to unpacking dictionary for protobuf messages May 27, 2026
@parthea parthea marked this pull request as ready for review May 27, 2026 19:13
@parthea parthea requested a review from a team as a code owner May 27, 2026 19:13
@parthea parthea merged commit 58df2da into main May 27, 2026
92 checks passed
@parthea parthea deleted the fragment-test branch May 27, 2026 20:09
chalmerlowe pushed a commit to googleapis/librarian that referenced this pull request May 28, 2026
…6183)

The version of gapic-generator in the embedded librarian.yaml (used by
librarian install) is updated to v1.34.1. This will unblock bigtable
generation (b/503326310) which needs the fix from
googleapis/google-cloud-python#17260 which is included in v1.34.0.
v1.34.0 could not be used due to a regression. The regression was fixed
in googleapis/google-cloud-python#17273 (hence
why we need gapic-generator v1.34.1 now).

See follow up issue to improve our testing strategy in
#6182

Signed-off-by: Anthonios Partheniou <partheniou@google.com>
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.

2 participants