GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Transcoding fails when HTTP request body contains a field name which is a reserved word in python · Issue #15074 · googleapis/google-cloud-python

Transcoding fails when HTTP request body contains a field name which is a reserved word in python #15074

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
Transcoding fails when HTTP request body contains a field name which is a reserved word in python#15074
Copy link
Assignees
atulep
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Description

@parthea
parthea
opened on Mar 7, 2023
Issue body actions

There is an error in googleapis/python-debugger-client#151 which occurs in the transcoding logic when the name of the request field whose value is mapped to the HTTP request body is a reserved word in python. In the case of python-debugger-client, the breakpoint field is used in the HTTP request body here.

See the transcode function below.
https://github.com/googleapis/python-api-core/blob/2a6a36bd820e1344c8b2526eb75d0b9f3a055d3b/google/api_core/path_template.py#L250-L252

Gapic generator python adds a trailing underscore to field names if the name is also a reserved word in Python. A similar issue was reported in googleapis/python-api-core#227 and fixed in googleapis/python-api-core#228. Based on comment googleapis/python-api-core#227 (comment) it is not possible for fields to have a trailing _ at the proto level (Creating a field like this generates an error from the protobuf runtime).

See build log https://github.com/googleapis/python-debugger-client/actions/runs/4292539515/jobs/7479094983 which shows the failure when a request has body with breakpoint_ instead of breakpoint.

>           response = client.set_breakpoint(request)

tests/unit/gapic/debugger_v2/test_debugger2.py:1920: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
google/cloud/debugger_v2/services/debugger2/client.py:547: in set_breakpoint
    response = rpc(
.nox/unit-3-8/lib/python3.8/site-packages/google/api_core/gapic_v1/method.py:113: in __call__
    return wrapped_func(*args, **kwargs)
.nox/unit-3-8/lib/python3.8/site-packages/google/api_core/timeout.py:120: in func_with_timeout
    return func(*args, **kwargs)
.nox/unit-3-8/lib/python3.8/site-packages/google/api_core/grpc_helpers.py:72: in error_remapped_callable
    return callable_(*args, **kwargs)
google/cloud/debugger_v2/services/debugger2/transports/rest.py:722: in __call__
    transcoded_request = path_template.transcode(http_options, pb_request)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

http_options = [{'body': 'breakpoint', 'method': 'post', 'uri': '/v2/debugger/debuggees/{debuggee_id}/breakpoints/set'}]
message = debuggee_id: "sample1"
breakpoint_ {
  id: "id_value"
  action: LOG
  location {
    path: "path_value"
    line: 424
...alue"
      type_: "type__value"
      var_table_index {
        value: 541
      }
      status {
      }
    }
  }
}

Activity

  1. parthea
    changed the title [-]Issue in transcoding when [/-] [+]Issue in transcoding when body has a reserved keyword[/+] on Mar 7, 2023
  2. parthea
    changed the title [-]Issue in transcoding when body has a reserved keyword[/-] [+]Issue in transcoding when body is a reserved word in python[/+] on Mar 8, 2023
  3. parthea
    changed the title [-]Issue in transcoding when body is a reserved word in python[/-] [+]Transcoding fails when HTTP request body contains a field name which is a reserved word in python[/+] on Mar 8, 2023
  4. parthea
    self-assigned this
    on Mar 24, 2023
  5. parthea
    added
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.
    on Mar 27, 2023
  6. parthea
    assigned
    atulep
    and unassigned
    parthea
    on Mar 29, 2023
  7. parthea
    added
    priority: p2Moderately-important priority. Fix may not be included in next release.
    and removed
    priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.
    on Apr 18, 2023
  8. parthea commented on Apr 18, 2023

    @parthea
    parthea
    on Apr 18, 2023
    ContributorAuthor
    More actions

    Bumping to P2 as this is blocking REST Transport support for 1 client library in googleapis/python-debugger-client#151. The REST Transport support feature has not yet launched for the python-debugger-client client library yet.

  9. parthea commented on Jan 12, 2026

    @parthea
    parthea
    on Jan 12, 2026
    ContributorAuthor
    More actions

    Transferring to google-cloud-python as the code for python-api-core will be migrated there in 1-3 weeks.

  10. parthea
    transferred this issue fromgoogleapis/python-api-coreon Jan 12, 2026
  11. daniel-sanche commented on May 27, 2026

    @daniel-sanche
    daniel-sanche
    on May 27, 2026
    Contributor
    More actions

    This issue is being closed as part of a bulk review (Filter #1). Please reopen if you believe this is still relevant and requires action.

  12. daniel-sanche
    closed this as not plannedon May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @atulep
    atulep

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.