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 — Refactored the Sentiment Analysis tutorial to use the Cloud Client Lib by jmdobry · Pull Request #713 · GoogleCloudPlatform/python-docs-samples

Conversation

@jmdobry

@jmdobry jmdobry commented Dec 12, 2016

Copy link
Copy Markdown
Member

Blocked by googleapis/google-cloud-python#2858

Sorry, something went wrong.

Uh oh!

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

All reactions
@jmdobry jmdobry added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Dec 12, 2016
@jmdobry
jmdobry requested a review from theacodes December 12, 2016 22:42
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Dec 12, 2016
@theacodes
theacodes requested a review from puneith December 12, 2016 22:47
theacodes
theacodes approved these changes Dec 12, 2016
View reviewed changes

@theacodes theacodes 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, but I'd like Puneith to take a look.

Sorry, something went wrong.

Uh oh!

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

All reactions
@jmdobry

jmdobry commented Dec 13, 2016

Copy link
Copy Markdown
Member Author

I think you mean @puneith

All reactions

Sorry, something went wrong.

Uh oh!

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

@jmdobry jmdobry self-assigned this Dec 13, 2016
@jmdobry
jmdobry force-pushed the sentiment-analysis branch from ee8e194 to 6f5a1b4 Compare December 14, 2016 23:21
@jmdobry jmdobry removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Dec 14, 2016
@jmdobry

jmdobry commented Dec 14, 2016

Copy link
Copy Markdown
Member Author

This is unblocked and ready for final review

All reactions

Sorry, something went wrong.

Uh oh!

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

@jmdobry
jmdobry force-pushed the sentiment-analysis branch from 6f5a1b4 to 8bca2aa Compare December 14, 2016 23:23
@jmdobry
jmdobry requested a review from gguuss December 14, 2016 23:28
gguuss
gguuss approved these changes Dec 15, 2016
View reviewed changes
puneith
puneith reviewed Dec 15, 2016
View reviewed changes
Comment thread language/sentiment/sentiment_analysis.py Outdated

for i, sentence in enumerate(response['sentences']):
sentence_sentiment = sentence['sentiment']['score']
for i, sentence in enumerate(annotations.sentences):

@puneith puneith Dec 15, 2016

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.

change the variable name from "i" to "index"

Sorry, something went wrong.

Uh oh!

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

All reactions

@jmdobry jmdobry Dec 15, 2016

Copy link
Copy Markdown
Member 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.

Done

Sorry, something went wrong.

Uh oh!

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

All reactions
@puneith

puneith commented Dec 15, 2016

Copy link
Copy Markdown
Contributor

Other than the earlier comment LGTM

All reactions

Sorry, something went wrong.

Uh oh!

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

@theacodes

theacodes commented Dec 15, 2016 via email

Copy link
Copy Markdown
Contributor
I'm okay with i, but "n" is idiomatic in combination with "enumerate".
…
On Wed, Dec 14, 2016, 11:45 PM Puneith Kaul ***@***.***> wrote: ***@***.**** commented on this pull request. ------------------------------ In language/sentiment/sentiment_analysis.py <#713 (review)> : > - service_request = service.documents().analyzeSentiment( - body={ - 'document': { - 'type': 'PLAIN_TEXT', - 'content': review_file.read(), - } - } - ) - response = service_request.execute() - - score = response['documentSentiment']['score'] - magnitude = response['documentSentiment']['magnitude'] - - for i, sentence in enumerate(response['sentences']): - sentence_sentiment = sentence['sentiment']['score'] + for i, sentence in enumerate(annotations.sentences): change the variable name from "i" to "index" — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#713 (review)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAPUc7DdGFUeyL7MQAKqDVcRqhcUm91Yks5rIPA0gaJpZM4LLHiM> .
All reactions

Sorry, something went wrong.

Uh oh!

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

@gguuss

gguuss commented Dec 15, 2016

Copy link
Copy Markdown
Contributor

FYI, it looks like flake8 is not liking a couple things:

nox > virtualenv /home/travis/build/GoogleCloudPlatform/python-docs-samples/.nox/lint-sample-language-sentiment
nox > pip install --upgrade flake8 flake8-import-order
nox > chdir ./language/sentiment
nox > flake8 --show-source --builtin gettext --max-complexity 15 --import-order-style google --exclude .nox,.cache,env,lib,generated_pb2 --application-import-names resources,sentiment_analysis_test,sentiment_analysis .
./sentiment_analysis.py:23:1: E302 expected 2 blank lines, found 1
def print_result(annotations):
^
./sentiment_analysis.py:51:13: E128 continuation line under-indented for visual indent
            include_syntax=False, include_entities=False)
All reactions

Sorry, something went wrong.

Uh oh!

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

@jmdobry
jmdobry force-pushed the sentiment-analysis branch from 8bca2aa to b805fe2 Compare December 15, 2016 18:25
@jmdobry
Refactored the Sentiment Analysis tutorial to use the Cloud Client Li…
348ff53
…brary.
@jmdobry
jmdobry force-pushed the sentiment-analysis branch from b805fe2 to 348ff53 Compare December 15, 2016 18:48
@theacodes
theacodes merged commit ca7a29b into master Dec 15, 2016
@theacodes
theacodes deleted the sentiment-analysis branch December 15, 2016 19:05
hkdevandla pushed a commit to hkdevandla/python-language that referenced this pull request Sep 26, 2020
@jmdobry Jon Wayne Parrott
Refactored the Sentiment Analysis tutorial to use the Cloud Client Li…
0d28236
…brary. [(#713)](GoogleCloudPlatform/python-docs-samples#713)
busunkim96 pushed a commit to googleapis/python-language that referenced this pull request Sep 29, 2020
@jmdobry @busunkim96
Refactored the Sentiment Analysis tutorial to use the Cloud Client Li…
f362d52
…brary. [(#713)](GoogleCloudPlatform/python-docs-samples#713)
m-strzelczyk pushed a commit that referenced this pull request Nov 18, 2022
@jmdobry @busunkim96
Refactored the Sentiment Analysis tutorial to use the Cloud Client Li…
de1ec35
…brary. [(#713)](#713)
@m-strzelczyk m-strzelczyk mentioned this pull request Nov 18, 2022
migrate code from googleapis/python-language #8533
Merged
8 tasks
parthea pushed a commit to googleapis/google-cloud-python that referenced this pull request Jul 6, 2023
@jmdobry @busunkim96
Refactored the Sentiment Analysis tutorial to use the Cloud Client Li…
23c867c
…brary. [(#713)](GoogleCloudPlatform/python-docs-samples#713)
Linchin added a commit that referenced this pull request Aug 18, 2025
@gcf-owl-bot @Linchin
fix: use retry_async instead of retry in async client (#713)
6f1ff93
* chore: Update gapic-generator-python to v1.12.0

PiperOrigin-RevId: 586356061

Source-Link: googleapis/googleapis@72a1f55

Source-Link: https://github.com/googleapis/googleapis-gen/commit/558a04bcd1cc0576e8fac1089e48e48b27ac161b
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTU4YTA0YmNkMWNjMDU3NmU4ZmFjMTA4OWU0OGU0OGIyN2FjMTYxYiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* feat: added Generator API
docs: updated doc for speech mode

PiperOrigin-RevId: 586469693

Source-Link: googleapis/googleapis@e8148d6

Source-Link: https://github.com/googleapis/googleapis-gen/commit/85136bd04383ed7172bb18b7b8d220dd7ff6b3a0
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiODUxMzZiZDA0MzgzZWQ3MTcyYmIxOGI3YjhkMjIwZGQ3ZmY2YjNhMCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Lingqing Gan <[email protected]>
@Linchin Linchin mentioned this pull request Aug 18, 2025
chore: migrate handwritten samples from googleapis/python-bigquery-storage #13543
Merged
9 tasks
chalmerlowe pushed a commit that referenced this pull request Apr 7, 2026
@renovate-bot
chore(deps): update dependency pytest to v7.0.1 (#713)
6fa3991
@chalmerlowe chalmerlowe mentioned this pull request Apr 7, 2026
migrate code from googleapis/python-storage #13989
Merged
9 tasks
@parthea parthea mentioned this pull request Sep 8, 2026
migrate code from googleapis/python-bigquery #14589
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

3 more reviewers
@puneith puneith puneith left review comments
@theacodes theacodes theacodes approved these changes
@gguuss gguuss gguuss approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

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

Assignees

@jmdobry jmdobry

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.

Uh oh!

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

5 participants

@jmdobry @puneith @theacodes @gguuss @googlebot
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.