-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Conversation
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.
Can we at least create a README guide on how to start this script/service?
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
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.
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.
Fixed lint issues, and I can add a README that links to the tutorial for this sample once the tutorial goes live. |
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
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.
It's probably still a good idea to generate the README by defining readme.rst.in example and calling the Readme-gen script.
@gguuss That template doesn't look like it applies here. The |
Ack. I can see about adding it for you after you merge. |
I adapted the existing sample from https://cloud.google.com/memorystore/docs/redis/connect-redis-instance-flex.