-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update logging codegen #1629
Update logging codegen #1629
Conversation
@@ -14,64 +14,123 @@ | |||
# | |||
# EDITING INSTRUCTIONS | |||
# This file was generated from the file | |||
# https://github.com/google/googleapis/blob/7710ead495227e80a0f06ceb66bdf3238d926f77/google/logging/v2/logging_config.proto, | |||
# https://github.com/google/googleapis/blob/master/google/logging/v2/logging_config.proto, |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
if app_name is None: | ||
app_name = 'gax' | ||
if app_version is None: | ||
app_version = google.gax.__version__ |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Design question. If the code is generated, couldn't you use the contents of the YAML file to just populate variables in the module? It seems that having to bear the weight of file I/O and parsing YAML is unneeded. |
'https://www.googleapis.com/auth/logging.admin', | ||
'https://www.googleapis.com/auth/logging.read', | ||
'https://www.googleapis.com/auth/cloud-platform.read-only', | ||
'https://www.googleapis.com/auth/cloud-platform', ) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
google_apis_agent = '{}-{}/{}/gax-{}/{}'.format( | ||
app_name, app_version, self._CODE_GEN_NAME_VERSION, | ||
google.gax.__version__, | ||
'python-{}'.format(platform.python_version())) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
OK I finished my comments. |
I feel the same way. There seems to be no real benefit to doing it this way. |
In the not too far-off future, the plan is to allow user configuration of api settings via yaml
|
Having a private key in it's own file is a security issue. Having user-overrides as code doesn't seem to be a problem. MyService(my_override='foo', your_setting='nope_mine', ...) |
# merge preserves those additions if the generated source changes. | ||
|
||
import os | ||
import platform | ||
|
||
from google.gax import api_callable |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Updates in response to feedback from PR: #1629 Fixes issues: * googleapis/gax-python#57: Incorrect comment referred to a domain name as a "DNS" * googleapis/gax-python#58: Incorrect proto was used in codegen, leading to a dangling link in the generated comments * googleapis/gax-python#59: Simplify the format string for the user- agent header * googleapis/gax-python#60: Use `{}` to initialize dictionaries * googleapis/gax-python#61: Use `pkg_resources` to load the client config file
port=DEFAULT_SERVICE_PORT, | ||
channel=None, | ||
ssl_creds=None, | ||
scopes=_ALL_SCOPES, |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
* Use {} rather than dict() * Use pkg_resources to load service config file * Simplify format string for tracking header and change separator to ';' instead of '/'. * Fix incorrect comment where "DNS" was used although "domain name" was meant See: googleapis/google-cloud-python#1629 Pre-push hook installed. Change-Id: I02c832dfcd34eed8f79338711d6e2d0e34cf0182
AFAIK, the generated code will land in a separate |
…gleCloudPlatform/python-docs-samples#1629) * [DO_NOT_MERGE] Moving the Dialogflow samples to the python-docs-samples repo * Add missing region tags for tracking * Style updates
Reflects updates to the code generation made between January and now.
An sample usage snippet is available here: https://gist.github.com/geigerj/de050b53f8887e9d7a07
@tbetbetbe
@anthmgoogle
@jgeewax