-
Notifications
You must be signed in to change notification settings - Fork 130
samplegen: convert binary type to str #2272
Conversation
@@ -4345,6 +4345,9 @@ def sample_publish_series(name): | |||
|
|||
# name = 'Math' | |||
|
|||
if isinstance(name, six.binary_type): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Codecov Report
@@ Coverage Diff @@
## master #2272 +/- ##
=========================================
Coverage 86.75% 86.75%
Complexity 5134 5134
=========================================
Files 452 452
Lines 20400 20400
Branches 2190 2190
=========================================
Hits 17699 17699
Misses 1930 1930
Partials 771 771 Continue to review full report at Codecov.
|
PTAL @vchudnov-g |
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.
Before merging, could you run it by the linter to make sure it doesn't complain about import order?
http://flake8.pycqa.org/en/latest/
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.
Sorry, too quick on my previous approve. I have one substantial comment.
(And as previously, before merging, could you run it by the linter to make sure it doesn't complain about import order?)
http://flake8.pycqa.org/en/latest/
@@ -35,6 +38,14 @@ | |||
@end | |||
|
|||
|
|||
# FIXME(hzyi): handle ListInitType, MapInitType and StructInitType correctly |
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.
@@ -23,6 +23,9 @@ | |||
@# [START {@sample.regionTag}] | |||
|
|||
{@importList(sample.initCode.importSection.appImports)} | |||
@if convertText(sample) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -76,6 +81,28 @@ | |||
@end | |||
@end | |||
|
|||
@private shouldImportSix(defaultParams) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -23,51 +23,59 @@ | |||
@# [START {@sample.regionTag}] | |||
|
|||
{@importList(sample.initCode.importSection.appImports)} | |||
@let convertTextCode = convertText(sample) |
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.
@@ -23,51 +23,59 @@ | |||
@# [START {@sample.regionTag}] | |||
|
|||
{@importList(sample.initCode.importSection.appImports)} | |||
@let convertTextCode = convertText(sample) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
For the record: flake8 lint check passed. |
* Generated sample: language_sentiment_text FYI generated from the following YAML GAPIC config: sample_value_sets: - id: analyze_sentiment title: "Analyzing Sentiment" description: "Proof of concept for analyzing sentiment" parameters: defaults: - document.type=PLAIN_TEXT - document.content="Your text to analyze, e.g. Hello, world!" attributes: - parameter: document.content sample_argument: true on_success: - define: sentiment=$resp.document_sentiment - print: - "Score: %s" - sentiment.score - print: - "Magnitude: %s" - sentiment.magnitude samples: standalone: - calling_forms: ".*" value_sets: analyze_sentiment region_tag: language_sentiment_text * Add requirements.txt (not currently generated) * Add test for language_sentiment_text (not currently generated) * Move language_python_migration_document_text Move language_python_migration_document_text so it uses a different snippet in preparation for deprecation of existing language_sentiment_text sample * Rename generated snippets so filename == region tag * Fix test for generated code sample (file rename to match region tag) * Update Copyright year to 2018 in new hand-written file * Fix lint errors of #language_sentiment_text test * Regenerate #language_sentiment_text to fix lint errors (updated Python sample template) * Binary string support in samples! From PR googleapis/gapic-generator#2272
* Generated sample: language_sentiment_text FYI generated from the following YAML GAPIC config: sample_value_sets: - id: analyze_sentiment title: "Analyzing Sentiment" description: "Proof of concept for analyzing sentiment" parameters: defaults: - document.type=PLAIN_TEXT - document.content="Your text to analyze, e.g. Hello, world!" attributes: - parameter: document.content sample_argument: true on_success: - define: sentiment=$resp.document_sentiment - print: - "Score: %s" - sentiment.score - print: - "Magnitude: %s" - sentiment.magnitude samples: standalone: - calling_forms: ".*" value_sets: analyze_sentiment region_tag: language_sentiment_text * Add requirements.txt (not currently generated) * Add test for language_sentiment_text (not currently generated) * Move language_python_migration_document_text Move language_python_migration_document_text so it uses a different snippet in preparation for deprecation of existing language_sentiment_text sample * Rename generated snippets so filename == region tag * Fix test for generated code sample (file rename to match region tag) * Update Copyright year to 2018 in new hand-written file * Fix lint errors of #language_sentiment_text test * Regenerate #language_sentiment_text to fix lint errors (updated Python sample template) * Binary string support in samples! From PR googleapis/gapic-generator#2272
…oogleCloudPlatform/python-docs-samples#1660) * Generated sample: language_sentiment_text FYI generated from the following YAML GAPIC config: sample_value_sets: - id: analyze_sentiment title: "Analyzing Sentiment" description: "Proof of concept for analyzing sentiment" parameters: defaults: - document.type=PLAIN_TEXT - document.content="Your text to analyze, e.g. Hello, world!" attributes: - parameter: document.content sample_argument: true on_success: - define: sentiment=$resp.document_sentiment - print: - "Score: %s" - sentiment.score - print: - "Magnitude: %s" - sentiment.magnitude samples: standalone: - calling_forms: ".*" value_sets: analyze_sentiment region_tag: language_sentiment_text * Add requirements.txt (not currently generated) * Add test for language_sentiment_text (not currently generated) * Move language_python_migration_document_text Move language_python_migration_document_text so it uses a different snippet in preparation for deprecation of existing language_sentiment_text sample * Rename generated snippets so filename == region tag * Fix test for generated code sample (file rename to match region tag) * Update Copyright year to 2018 in new hand-written file * Fix lint errors of #language_sentiment_text test * Regenerate #language_sentiment_text to fix lint errors (updated Python sample template) * Binary string support in samples! From PR googleapis/gapic-generator#2272
…oogleCloudPlatform/python-docs-samples#1660) * Generated sample: language_sentiment_text FYI generated from the following YAML GAPIC config: sample_value_sets: - id: analyze_sentiment title: "Analyzing Sentiment" description: "Proof of concept for analyzing sentiment" parameters: defaults: - document.type=PLAIN_TEXT - document.content="Your text to analyze, e.g. Hello, world!" attributes: - parameter: document.content sample_argument: true on_success: - define: sentiment=$resp.document_sentiment - print: - "Score: %s" - sentiment.score - print: - "Magnitude: %s" - sentiment.magnitude samples: standalone: - calling_forms: ".*" value_sets: analyze_sentiment region_tag: language_sentiment_text * Add requirements.txt (not currently generated) * Add test for language_sentiment_text (not currently generated) * Move language_python_migration_document_text Move language_python_migration_document_text so it uses a different snippet in preparation for deprecation of existing language_sentiment_text sample * Rename generated snippets so filename == region tag * Fix test for generated code sample (file rename to match region tag) * Update Copyright year to 2018 in new hand-written file * Fix lint errors of #language_sentiment_text test * Regenerate #language_sentiment_text to fix lint errors (updated Python sample template) * Binary string support in samples! From PR googleapis/gapic-generator#2272
…oogleCloudPlatform/python-docs-samples#1660) * Generated sample: language_sentiment_text FYI generated from the following YAML GAPIC config: sample_value_sets: - id: analyze_sentiment title: "Analyzing Sentiment" description: "Proof of concept for analyzing sentiment" parameters: defaults: - document.type=PLAIN_TEXT - document.content="Your text to analyze, e.g. Hello, world!" attributes: - parameter: document.content sample_argument: true on_success: - define: sentiment=$resp.document_sentiment - print: - "Score: %s" - sentiment.score - print: - "Magnitude: %s" - sentiment.magnitude samples: standalone: - calling_forms: ".*" value_sets: analyze_sentiment region_tag: language_sentiment_text * Add requirements.txt (not currently generated) * Add test for language_sentiment_text (not currently generated) * Move language_python_migration_document_text Move language_python_migration_document_text so it uses a different snippet in preparation for deprecation of existing language_sentiment_text sample * Rename generated snippets so filename == region tag * Fix test for generated code sample (file rename to match region tag) * Update Copyright year to 2018 in new hand-written file * Fix lint errors of #language_sentiment_text test * Regenerate #language_sentiment_text to fix lint errors (updated Python sample template) * Binary string support in samples! From PR googleapis/gapic-generator#2272
No description provided.