Skip to content

[WIP] Update gapic v1.38 - #18082

Draft
hebaalazzeh wants to merge 4 commits into
mainfrom
update-gapic-v1.38
Draft

[WIP] Update gapic v1.38#18082
hebaalazzeh wants to merge 4 commits into
mainfrom
update-gapic-v1.38

Conversation

@hebaalazzeh

Copy link
Copy Markdown
Contributor

WIP

@hebaalazzeh hebaalazzeh self-assigned this Aug 12, 2026

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

Copy link
Copy Markdown
Contributor

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 refactors the REST transport layer across the google-cloud-build and google-cloud-iam packages by centralizing request transcoding logic into new _compat.py modules. It removes legacy version check logic and redundant _get_unset_required_fields methods, replacing them with a centralized transcode_request function. Additionally, it updates dependency constraints and adds a disable_mtls_env fixture to unit tests. The reviewer identified two issues in the new _compat.py files where dictionary-like access was incorrectly used on a NamedTuple returned by path_template.transcode, and provided code suggestions to use attribute access instead.

Comment on lines +198 to +200
if transcoded_request.get("body") is not None:
body_json = json_format.MessageToJson(
transcoded_request["body"],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The transcoded_request object returned by path_template.transcode is a NamedTuple (TranscodedRequest), which does not support dictionary-like .get() access or string-based indexing (e.g., transcoded_request["body"]). Attempting to use .get() will raise an AttributeError, and string indexing will raise a TypeError. Please use attribute access instead (e.g., transcoded_request.body and transcoded_request.query_params).

Suggested change
if transcoded_request.get("body") is not None:
body_json = json_format.MessageToJson(
transcoded_request["body"],
if transcoded_request.body is not None:
body_json = json_format.MessageToJson(
transcoded_request.body,

Comment on lines +204 to +208
query_params_json = {}
if transcoded_request.get("query_params") is not None:
query_params_json = json.loads(
json_format.MessageToJson(
transcoded_request["query_params"],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The transcoded_request object returned by path_template.transcode is a NamedTuple (TranscodedRequest), which does not support dictionary-like .get() access or string-based indexing (e.g., transcoded_request["query_params"]). Attempting to use .get() will raise an AttributeError, and string indexing will raise a TypeError. Please use attribute access instead (e.g., transcoded_request.query_params).

Suggested change
query_params_json = {}
if transcoded_request.get("query_params") is not None:
query_params_json = json.loads(
json_format.MessageToJson(
transcoded_request["query_params"],
query_params_json = {}
if transcoded_request.query_params is not None:
query_params_json = json.loads(
json_format.MessageToJson(
transcoded_request.query_params,

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.

1 participant