-
Notifications
You must be signed in to change notification settings - Fork 14
docs(samples): add retail search service samples #133
Conversation
Here is the summary of changes. You are about to add 7 region tags.
This comment is generated by snippet-bot.
|
@kweinmeister , @chenlei1216 The code samples are moved to the folder "samples/interactive-tutorials" to separate them from the code samples, which are used for displaying in the static documentation pages. In this PR I have created the code samples for Retail Search service and tests. I have modified .kokoro configs to read the secrets from "retail-samples-secrets" secret manager. For the tests we use our own Cloud project with preset catalog data. And I would like to ask you how should I add the service account token to our project to authorize tests? Thank you |
0766a04
to
9219e81
Compare
print("---search response---") | ||
print(search_response_first_page) | ||
|
||
# PASTE CALL WITH NEXT PAGE TOKEN HERE: |
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.
Maybe add code samples how to get the next page token?
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.
We provide the code here, in the tutorial https://github.com/t-karasova/python-retail/blob/readme/samples/interactive-tutorials/tutorials/retail_api_v2_pagination_python.neos.md, and we ask user to copy it and paste under the specific comment in the code. we did it to increase the user engagement into the learning process.
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.
the code is the following:
search_request_next_page = get_search_request("Hoodie", page_size, offset, next_page_token)
search_response_next_page = SearchServiceClient().search(search_request_next_page)
print("---next page search results---")
print(search_response_next_page)
Current failure for python 3.7 samples :
|
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.
Added minor observations
The tests appear to be running now. There are 2 unit test failures:
|
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
0a105aa
to
4e342c6
Compare
* feat: Retail Interactive Tutorials. Search service code samples * use default project for testing purposes * add pytest-xdist as a requirement for testing * fail on missing environment variable * for testing purposes * for testing purposes * for testing purposes * updated according to the review comments * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * try out GOOGLE_CLOUD_PROJECT_NUMBER instead of PROJECT_NUMBER * add BUCKET_NAME as an environment variable * adjust filepath so tests can run * tests are fixed * Update samples/interactive-tutorials/README.md Co-authored-by: Anthonios Partheniou <partheniou@google.com> * README file is updated * fix typo in pip install command Co-authored-by: Karl Weinmeister <11586922+kweinmeister@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com> Co-authored-by: t-karasova <tkarasyova@griddynamics.com> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
* feat: Retail Interactive Tutorials. Search service code samples * use default project for testing purposes * add pytest-xdist as a requirement for testing * fail on missing environment variable * for testing purposes * for testing purposes * for testing purposes * updated according to the review comments * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * try out GOOGLE_CLOUD_PROJECT_NUMBER instead of PROJECT_NUMBER * add BUCKET_NAME as an environment variable * adjust filepath so tests can run * tests are fixed * Update samples/interactive-tutorials/README.md Co-authored-by: Anthonios Partheniou <partheniou@google.com> * README file is updated * fix typo in pip install command Co-authored-by: Karl Weinmeister <11586922+kweinmeister@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com> Co-authored-by: t-karasova <tkarasyova@griddynamics.com> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
* feat: Retail Interactive Tutorials. Search service code samples * use default project for testing purposes * add pytest-xdist as a requirement for testing * fail on missing environment variable * for testing purposes * for testing purposes * for testing purposes * updated according to the review comments * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * try out GOOGLE_CLOUD_PROJECT_NUMBER instead of PROJECT_NUMBER * add BUCKET_NAME as an environment variable * adjust filepath so tests can run * tests are fixed * Update samples/interactive-tutorials/README.md Co-authored-by: Anthonios Partheniou <partheniou@google.com> * README file is updated * fix typo in pip install command Co-authored-by: Karl Weinmeister <11586922+kweinmeister@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com> Co-authored-by: t-karasova <tkarasyova@griddynamics.com> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
* feat: Retail Interactive Tutorials. Search service code samples * use default project for testing purposes * add pytest-xdist as a requirement for testing * fail on missing environment variable * for testing purposes * for testing purposes * for testing purposes * updated according to the review comments * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * try out GOOGLE_CLOUD_PROJECT_NUMBER instead of PROJECT_NUMBER * add BUCKET_NAME as an environment variable * adjust filepath so tests can run * tests are fixed * Update samples/interactive-tutorials/README.md Co-authored-by: Anthonios Partheniou <partheniou@google.com> * README file is updated * fix typo in pip install command Co-authored-by: Karl Weinmeister <11586922+kweinmeister@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com> Co-authored-by: t-karasova <tkarasyova@griddynamics.com> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #<issue_number_goes_here> 🦕