Skip to content

Add Python code sample for Cloud Functions + Memorystore for Redis #2181

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

Merged
merged 2 commits into from Jul 30, 2019
Merged

Add Python code sample for Cloud Functions + Memorystore for Redis #2181

merged 2 commits into from Jul 30, 2019

Conversation

ghost
Copy link

@ghost ghost commented May 29, 2019

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label May 29, 2019
Copy link
Contributor

@grant grant left a comment

Choose a reason for hiding this comment

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

Can we at least create a README guide on how to start this script/service?

Copy link
Contributor

@engelke engelke left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@gguuss gguuss left a comment

Choose a reason for hiding this comment

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

Looks like lint is failing:

./main.py:24:1: E302 expected 2 blank lines, found 1
def visit_count(request):
^
./main.py:25:3: E111 indentation is not a multiple of four
  value = redis_client.incr('visits', 1)
  ^
./main.py:26:3: E111 indentation is not a multiple of four
  return 'Visit count: {}'.format(value)
  ^
nox > Command flake8 --show-source --builtin gettext --max-complexity 20 --import-order-style google --exclude .nox,.cache,env,lib,generated_pb2,*_pb2.py,*_pb2_grpc.py --ignore=E121,E123,E126,E226,E24,E704,W503,W504,I100,I201,I202 --application-import-names main . failed with exit code 1
nox > Session lint(sample='./functions/memorystore/redis') failed.
The command "./scripts/travis.sh" exited with 1.

@ghost
Copy link
Author

ghost commented Jul 29, 2019

Fixed lint issues, and I can add a README that links to the tutorial for this sample once the tutorial goes live.

Copy link
Contributor

@gguuss gguuss left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@gguuss gguuss left a comment

Choose a reason for hiding this comment

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

It's probably still a good idea to generate the README by defining readme.rst.in example and calling the Readme-gen script.

@ghost
Copy link
Author

ghost commented Jul 30, 2019

@gguuss That template doesn't look like it applies here. The main.py file is not a script you run locally like that. I would use a simple README.md like the rest of the functions samples do.

@gguuss
Copy link
Contributor

gguuss commented Jul 30, 2019

@gguuss That template doesn't look like it applies here. The main.py file is not a script you run locally like that. I would use a simple README.md like the rest of the functions samples do.

Ack. I can see about adding it for you after you merge.

@gguuss gguuss merged commit 920b347 into GoogleCloudPlatform:master Jul 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants