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 — feat: add rest transport generation for clients with optional flag by yon-mg · Pull Request #688 · googleapis/gapic-generator-python

This repository was archived by the owner on Aug 25, 2026. It is now read-only.

Conversation

@yon-mg

@yon-mg yon-mg commented Nov 2, 2020 •
edited by vam-google
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

This pr adds traditional rest/json transport to GAPIC clients. As of now, this does not yet handle all cases and there may be bugs in the generated client. As such, there is now a --transport flag set to 'grpc' by default so any new additions won't be reflected in generated clients.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@yon-mg
feat: add rest transport generation for clients
c1a6f89
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Nov 2, 2020
@yon-mg
yon-mg marked this pull request as ready for review November 2, 2020 18:09
@yon-mg
yon-mg requested a review from a team November 2, 2020 18:09
@yon-mg
yon-mg marked this pull request as draft November 2, 2020 18:17
yon-mg added 2 commits November 2, 2020 18:47
@yon-mg
feat: add rest transport generation for clients
bd7c32d
@yon-mg
Merge branch 'master' of github.com:yon-mg/gapic-generator-python
cd3a7f1
@yon-mg
yon-mg requested review from software-dov, vam-google and vchudnov-g November 2, 2020 18:57
software-dov
software-dov reviewed Nov 2, 2020
View reviewed changes

@software-dov software-dov left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

First pass, some broad outlines and some nitpicking.

I'm more in favor of naming the new transport and its module "Http" instead of Rest; it is possible to do protobuf over http, and it's more immediately obvious to someone swimming in the code what it means.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/grpc.py.j2 Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest.py.j2 Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest.py.j2 Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest.py.j2 Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest.py.j2 Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest.py.j2 Outdated


{%- for method in service.methods.values() %}
{# TODO(yonmg): consider using enums #}

@software-dov software-dov Nov 2, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

+1 for using enums.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest.py.j2 Outdated
Comment on lines +143 to +157
{%- if ns.http.get != '' %}
{%- set ns.httpMethod = {'method':'get','url':ns.http.get} %}
{%- elif ns.http.put != '' %}
{%- set ns.httpMethod = {'method':'put','url':ns.http.put} %}
{%- elif ns.http.post != '' %}
{%- set ns.httpMethod = {'method':'post','url':ns.http.post} %}
{%- elif ns.http.delete != '' %}
{%- set ns.httpMethod = {'method':'delete','url':ns.http.delete} %}
{%- elif ns.http.patch != '' %}
{%- set ns.httpMethod = {'method':'patch','url':ns.http.patch} %}
{%- elif ns.http.custom != '' %}
{%- set ns.httpMethod = {'method':'custom','url':ns.http.custom} %}
{%- else %}
{%- set ns.httpMethod = None %}
{%- endif %}

@software-dov software-dov Nov 2, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I'm leaning towards anything that involves state modification living in the generator datatypes. It's easier to test and easier to change if we need to.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@yon-mg yon-mg Nov 2, 2020

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I'm not sure I understand what you mean by generator datatypes. Could you clarify?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@software-dov software-dov Nov 2, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

The gapic/schema/wrappers.py:{MessageType,Service,Method} classes. The auxiliary datastructures that the generate creates before iterating over the templates.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@yon-mg yon-mg changed the title feat: add rest transport generation for clients feat WIP: add rest transport generation for clients Nov 2, 2020
@busunkim96

busunkim96 commented Nov 2, 2020

Copy link
Copy Markdown
Contributor

Is the REST transport going to be added in one PR? If not, can we maintain a long-running branch and merge to it instead?

The microgenerator is now relied on by Cloud clients at GA stability so I'd prefer not to to surface this until it is somewhat stable.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@yon-mg

yon-mg commented Nov 2, 2020

Copy link
Copy Markdown
Contributor Author

Is the REST transport going to be added in one PR? If not, can we maintain a long-running branch and merge to it instead?

The microgenerator is now relied on by Cloud clients at GA stability so I'd prefer not to to surface this until it is somewhat stable.

This sounds reasonable to me. I'll defer to the other reviewers on what the best practice should be. @software-dov @vam-google @vchudnov-g

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@yon-mg yon-mg changed the title feat WIP: add rest transport generation for clients feat[WIP]: add rest transport generation for clients Nov 2, 2020
@software-dov

software-dov commented Nov 2, 2020

Copy link
Copy Markdown
Contributor

If it's not too much work, I think I'd be more in favor of feature toggles and small PRs instead of having a long-running branch. It's easier to do merging. If that seems like too much work, I'm okay with a long-running branch.

busunkim96 and vchudnov-g reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@software-dov
software-dov requested a review from busunkim96 November 3, 2020 18:36
yon-mg added 2 commits November 6, 2020 19:42
@yon-mg
feat: add transport flag
b41db31
@yon-mg
refactor: moved template logic outside
ce69e7d
@yon-mg
yon-mg requested a review from software-dov November 6, 2020 21:17
@yon-mg

yon-mg commented Nov 6, 2020

Copy link
Copy Markdown
Contributor Author

I'm more in favor of naming the new transport and its module "Http" instead of Rest; it is possible to do protobuf over http, and it's more immediately obvious to someone swimming in the code what it means.

I agree with this somewhat but for consistency across other languages, flag arguments and regapic design specs, I think it's more appropriate to name it Rest. In addition, it's because it's possible to do protobuf over http that naming it such may be ambiguous. Rest seems to me more clearly defined.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

software-dov
software-dov reviewed Nov 6, 2020
View reviewed changes

@software-dov software-dov left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Looks good, just a few things.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread gapic/utils/options.py Outdated
lazy_import: bool = False
old_naming: bool = False
add_iam_methods: bool = False
# TODO(yonmg): should there be an enum for transport type?

@software-dov software-dov Nov 6, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

+1 for using an enum

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread gapic/utils/options.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread gapic/generator/generator.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@yon-mg
fix: small fixes in transport option logic
89fa08b
software-dov
software-dov reviewed Nov 9, 2020
View reviewed changes
Comment thread gapic/generator/generator.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread gapic/schema/wrappers.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

yon-mg added 2 commits November 9, 2020 22:59
@yon-mg
test: added unit test for transport flag
86f3a9c
@yon-mg
test: add unit test for http option method
234cc09
@yon-mg yon-mg changed the title feat[WIP]: add rest transport generation for clients feat(WIP): add rest transport generation for clients Nov 11, 2020
yon-mg added 3 commits November 11, 2020 14:01
@yon-mg
test: add unit test for http option method branch
35ac276
@yon-mg
fix: fix import paths
c8155a5
@yon-mg
fix: style check issues
55a815c
@yon-mg
fix: more style check issues
ac0bdef
@codecov

codecov Bot commented Nov 11, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

Merging #688 (b5c6d06) into master (b85cbd4) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #688   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           26        26           
  Lines         1560      1578   +18     
  Branches       316       320    +4     
=========================================
+ Hits          1560      1578   +18     
Impacted Files Coverage Δ
gapic/generator/generator.py 100.00% <100.00%> (ø)
gapic/schema/wrappers.py 100.00% <100.00%> (ø)
gapic/utils/options.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b85cbd4...b5c6d06. Read the comment docs.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@yon-mg
yon-mg requested a review from software-dov November 11, 2020 14:42
@yon-mg yon-mg changed the title feat(WIP): add rest transport generation for clients feat: add rest transport generation for clients Nov 11, 2020
@yon-mg
yon-mg marked this pull request as ready for review November 11, 2020 19:44
software-dov
software-dov reviewed Nov 11, 2020
View reviewed changes

@software-dov software-dov left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM, just two minor nits.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread tests/unit/generator/test_generator.py Outdated
]
with mock.patch.object(jinja2.Environment, "get_template") as gt:
gt.return_value = jinja2.Template("Service: {{ service.name }}")
cgr = g.get_response(api_schema=make_api(

@software-dov software-dov Nov 10, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Formatting nit: putting this on a new line makes it slightly easier to read the entire thing.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread gapic/generator/generator.py Outdated
Comment on lines +278 to +279
'transport' in template_name
and not self._is_desired_transport(template_name, opts)

@software-dov software-dov Nov 11, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Can you put parentheses around this chunk, just to make it clear that it's a cohesive unit?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread gapic/utils/options.py Outdated
from collections import defaultdict
from os import path
from typing import Any, DefaultDict, Dict, FrozenSet, List, Optional, Tuple
from typing import Any, DefaultDict, Dict, FrozenSet, List, Optional, Tuple, Set

@software-dov software-dov Nov 11, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Is Set used somewhere?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
software-dov
software-dov approved these changes Nov 11, 2020
View reviewed changes
vam-google
vam-google approved these changes Nov 12, 2020
View reviewed changes

@vam-google vam-google left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM
All the comments are minor. Please address them and then push the changes (please use squash and merge button). Thanks @software-dov for sharing your expertise in Python review!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread gapic/ads-templates/%namespace/%name/%version/__init__.py.j2 Outdated
'{{ enum.name }}': '{{ enum.ident.package|join('.') }}.types.{{enum.ident.module }}',
{%- endfor %}

{# TODO(yonmg): add rest transport service once I know what this is #}

@vam-google vam-google Nov 12, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Please use your github id for TODOs (here and in the other places)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@vchudnov-g vchudnov-g Nov 12, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

+1

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread gapic/schema/wrappers.py Outdated
server='stream' if self.server_streaming else 'unary',
)

# TODO(yonmg): figure out why idempotent is reliant on http annotation

@vam-google vam-google Nov 12, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

http GET requests are automatically considered idempotent because they do not change data on the server. Post requests are usually non-idempotent, because it is usually unsafe retry write operation if it failed, because it may lead for example into writing the same information twice on the server.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@yon-mg yon-mg Nov 12, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I get that GET is idempotent but couldn't there be methods without an http annotation that are also idempotent? are grpc only methods inherently not so?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/grpc.py.j2
# Sanity check: Only create a new client if we do not already have one.
if 'operations_client' not in self.__dict__:
self.__dict__['operations_client'] = operations_v1.OperationsClient(
if self._operations_client is None:

@vam-google vam-google Nov 12, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

won't if not self._operation_client work? I thought it was more idiomatic for python.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@software-dov software-dov Nov 13, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

It's a little bit complicated. Some values can be falsy even if they are non-null, e.g. empty lists and strings.
In this particular case, it's slightly more idiomatic to do if self._operations_client, but I personally am fine with explicit checks in cases like this.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/grpc.py.j2
"""Create and return a gRPC channel object.
Args:
address (Optionsl[str]): The host for the channel to use.
address (Optional[str]): The host for the channel to use.

@vam-google vam-google Nov 12, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Why was this changed (looks unrelated to your changes)?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@yon-mg yon-mg Nov 12, 2020

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Typo

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@vchudnov-g vchudnov-g Nov 12, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I approve of fixing typos on the fly!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/grpc_asyncio.py.j2
# Sanity check: Only create a new client if we do not already have one.
if 'operations_client' not in self.__dict__:
self.__dict__['operations_client'] = operations_v1.OperationsAsyncClient(
if self._operations_client is None:

@vam-google vam-google Nov 12, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Why are you changing this code (looks unrelated to http transport stuff)?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@yon-mg yon-mg Nov 12, 2020

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

#688 (comment)
I decided to update the other templates as well for consistency.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@software-dov software-dov Nov 13, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

+1 for consistency

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest.py.j2 Outdated
__all__ = (
'{{ service.name }}RestTransport',
)
{% endblock %} No newline at end of file

@vam-google vam-google Nov 12, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Please add new line

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
vchudnov-g
vchudnov-g approved these changes Nov 12, 2020
View reviewed changes

@vchudnov-g vchudnov-g left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Looks good. Only minor comments. Nice job! Very excited to have this in!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread gapic/ads-templates/%namespace/%name/%version/__init__.py.j2 Outdated
'{{ enum.name }}': '{{ enum.ident.package|join('.') }}.types.{{enum.ident.module }}',
{%- endfor %}

{# TODO(yonmg): add rest transport service once I know what this is #}

@vchudnov-g vchudnov-g Nov 12, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

+1

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread gapic/cli/generate.py

# Pull apart arguments in the request.
opts = Options.build(req.parameter)

@vchudnov-g vchudnov-g Nov 12, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

nit: I like having the blank line here for readability.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread gapic/schema/wrappers.py Outdated
# Return the usual output.
return self.output

# TODO(yonmg): remove or rewrite. don't think it performs as intended

@vchudnov-g vchudnov-g Nov 12, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

nit: Suggest adding just a tiny bit more detail. It often happens that the person working on the TODO is not the person who wrote it, so adding some context is a helpful practice.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread gapic/schema/wrappers.py Outdated
}
if len(http) > 1:
http_opt = http[1]
answer[http_opt[0].name] = http_opt[1]

@vchudnov-g vchudnov-g Nov 12, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

For clarity I would suggest

body_spec = http[1]
answer[body_spec[0].name] = body_spec[1]

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread gapic/schema/wrappers.py Outdated

http_method = http[0]
answer: Dict[str, str] = {
'method': http_method[0].name,

@vchudnov-g vchudnov-g Nov 12, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Based on our offline discussion, let's s/'method'/'verb'/, since "method" is overloaded (service method, object method, HTTP method)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@software-dov software-dov Nov 13, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

If this be madness, there be method to it! 💀

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

yon-mg reacted with laugh emoji
All reactions
  • 😄 1 reaction
Comment thread gapic/schema/wrappers.py
@property
def http_opt(self) -> Optional[Dict[str, str]]:
"""Return the http option for this method."""
http = self.options.Extensions[annotations_pb2.http].ListFields()

@vchudnov-g vchudnov-g Nov 12, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I do think a type declaration or a comment saying this is a List[Tuple[FieldDescriptor, str]] would be helpful.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread gapic/templates/%namespace/%name_%version/%sub/services/%service/client.py.j2 Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread gapic/utils/options.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/grpc.py.j2
"""Create and return a gRPC channel object.
Args:
address (Optionsl[str]): The host for the channel to use.
address (Optional[str]): The host for the channel to use.

@vchudnov-g vchudnov-g Nov 12, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I approve of fixing typos on the fly!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread gapic/schema/wrappers.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

yon-mg added 3 commits November 13, 2020 20:04
@yon-mg
fix: addressing pr reviews
e79e8c7
@yon-mg
fix: typo in test_method
824ad11
@yon-mg
fix: style check fixes
2d11e19
@yon-mg yon-mg changed the title feat: add rest transport generation for clients feat: add rest transport generation for clients with optional flag Nov 14, 2020
@yon-mg
Merge branch 'master' into master
b5c6d06
@yon-mg
yon-mg merged commit af59c2c into googleapis:master Nov 14, 2020
gcf-merge-on-green Bot pushed a commit that referenced this pull request Nov 16, 2020
@release-please
chore: release 0.36.0 (#700)
996515d
🤖 I have created a release \*beep\* \*boop\* 
---
## [0.36.0](https://www.github.com/googleapis/gapic-generator-python/compare/v0.35.11...v0.36.0) (2020-11-14)


### Features

* add rest transport generation for clients with optional transport flag ([#688](https://www.github.com/googleapis/gapic-generator-python/issues/688)) ([af59c2c](https://www.github.com/googleapis/gapic-generator-python/commit/af59c2c3c3d6b7e1f626c3fbc2c03f99ca31b4a4))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please).
@software-dov software-dov mentioned this pull request Nov 16, 2020
feat: generator options are parsed into a standalone struct googleapis/gapic-generator-go#479
Merged
@busunkim96 busunkim96 linked an issue Jan 6, 2021 that may be closed by this pull request
Re-add HTTP transport and make it the fallback #267
Closed
@yon-mg yon-mg mentioned this pull request Jan 28, 2021
showcase unit tests missing for rest transport #744
Closed
This was referenced Jan 18, 2022
chore(master): release reverted #1133
Merged
chore(master): release 0.39.1 #1146
Closed
This was referenced Jan 26, 2022
chore(main): release 0.39.1 #1160
Closed
chore(main): release 0.39.1 #1162
Closed
chore(main): release 0.61.0 #1163
Merged
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@busunkim96 busunkim96 Awaiting requested review from busunkim96
3 more reviewers
@software-dov software-dov software-dov approved these changes
@vchudnov-g vchudnov-g vchudnov-g approved these changes
@vam-google vam-google vam-google approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Re-add HTTP transport and make it the fallback

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@yon-mg @busunkim96 @software-dov @vchudnov-g @vam-google
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.