Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

samplegen: convert binary type to str #2272

Merged
merged 7 commits into from
Aug 30, 2018

Conversation

yihanzhen
Copy link
Contributor

No description provided.

@@ -4345,6 +4345,9 @@ def sample_publish_series(name):

# name = 'Math'

if isinstance(name, six.binary_type):

This comment was marked as spam.

@codecov-io
Copy link

codecov-io commented Aug 29, 2018

Codecov Report

Merging #2272 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            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.

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

@yihanzhen
Copy link
Contributor Author

PTAL @vchudnov-g

Copy link
Contributor

@vchudnov-g vchudnov-g left a 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/

Copy link
Contributor

@vchudnov-g vchudnov-g left a 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.

@@ -23,6 +23,9 @@
@# [START {@sample.regionTag}]

{@importList(sample.initCode.importSection.appImports)}
@if convertText(sample)

This comment was marked as spam.

@@ -76,6 +81,28 @@
@end
@end

@private shouldImportSix(defaultParams)

This comment was marked as spam.

@@ -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.

@@ -23,51 +23,59 @@
@# [START {@sample.regionTag}]

{@importList(sample.initCode.importSection.appImports)}
@let convertTextCode = convertText(sample)

This comment was marked as spam.

@yihanzhen
Copy link
Contributor Author

For the record: flake8 lint check passed.

@yihanzhen yihanzhen merged commit a05cf23 into googleapis:master Aug 30, 2018
beccasaurus pushed a commit to GoogleCloudPlatform/python-docs-samples that referenced this pull request Aug 30, 2018
beccasaurus added a commit to GoogleCloudPlatform/python-docs-samples that referenced this pull request Aug 30, 2018
* 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
ace-n pushed a commit to GoogleCloudPlatform/python-docs-samples that referenced this pull request Aug 30, 2018
* 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
busunkim96 pushed a commit to busunkim96/python-language that referenced this pull request May 20, 2020
…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
hkdevandla pushed a commit to hkdevandla/python-language that referenced this pull request Sep 26, 2020
…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
busunkim96 pushed a commit to googleapis/python-language that referenced this pull request Sep 29, 2020
…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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants