-
Notifications
You must be signed in to change notification settings - Fork 5
docs: add sync api samples with json request #13
docs: add sync api samples with json request #13
Conversation
Here is the summary of possible violations 😱 There is a possible violation for not having product prefix.
The end of the violation section. All the stuff below is FYI purposes only. Here is the summary of changes. You are about to add 1 region tag.
This comment is generated by snippet-bot.
|
I'm noticing that samples tests are passing but aren't actually running due to the lack of noxfile. I've flagged this to @googleapis/python-samples-owners as a concern to address. I'll send you individual instructions for running local samples tests as a workaround. |
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.
I added a few comments, but I also have a few overall requests
- Please add a
requirements.txt
file to the same directory your samples are in with libraries needed for your sample to run and have them pinned to specific versions (for example - https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/composer/rest/requirements.txt) - Please add a
requirements.txt
file to the same directory your samples are in with libraries needed for tests to run. It will likely be identical to this one since your test doesn't call any additional 3rd party libraries (https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/composer/rest/requirements-test.txt) - Please add a
noxfile-config.py
file to the directory where your samples are. This will enforce type hinting and specify which versions of Python to test in (by default, we test in 3.7, 3.8, 3.9, and 3.10. If your product does not support one of those versions, please exempt it in this file by adding the version to the list with 2.7 and 3.6). You can copy this file directly. This configuration file will interact with a noxfile that will be generated once a requirements file is present. The noxfile configures nox, our test runner - Please add type hints, they are required per the authoring guide
@changsongd I pinged you about why the noxfile reappeared! one that was generated SHOULD be there now - sorry - so confusing, I know! |
Oh, I think I accidentally deleted it. Will the OwlBot be triggered again and re-generate that file? |
I've now enabled the maps plugin and will retry |
Weird, I'm seeing 403s on two versions of Python but not on two others? 🤔 I'll try a re-run to see if it's consistent |
Still trying to get the samples lint check to show up |
trigger owlbot because it looks a lil stuck |
* add code snippets for sync and async api * remove async test samples * use f-string * change project_id to input arg * add noxfile * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * rename noxfile and add requirements * rm noxfile * rm noxfile local * add root noxfile * Update noxfile.py * Update noxfile.py * Update noxfile.py Co-authored-by: Leah E. Cole <6719667+leahecole@users.noreply.github.com> * Apply suggestions from code review * Update noxfile.py * Update noxfile.py * Update noxfile.py * Update noxfile.py * Update noxfile.py * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Add commit to trigger kokoro * add indentation * add type annotations Co-authored-by: Jeffrey Rennie <rennie@google.com> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Leah E. Cole <6719667+leahecole@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
* Add get_operation code snippets * update comment * docs: add sync api samples with json request (#13) * add code snippets for sync and async api * remove async test samples * use f-string * change project_id to input arg * add noxfile * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * rename noxfile and add requirements * rm noxfile * rm noxfile local * add root noxfile * Update noxfile.py * Update noxfile.py * Update noxfile.py Co-authored-by: Leah E. Cole <6719667+leahecole@users.noreply.github.com> * Apply suggestions from code review * Update noxfile.py * Update noxfile.py * Update noxfile.py * Update noxfile.py * Update noxfile.py * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Add commit to trigger kokoro * add indentation * add type annotations Co-authored-by: Jeffrey Rennie <rennie@google.com> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Leah E. Cole <6719667+leahecole@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com> * rebase and add type annotations * fix operation_id type * Update samples/snippets/get_operation.py Co-authored-by: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> * Update samples/snippets/get_operation_test.py Co-authored-by: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> * move TODO outside func, create operation in test * lint fix * fix asyncmodelconfig * change model_config to list * add blank line * change request to dict * change parent to project id * remove model config * Update samples/snippets/get_operation.py Co-authored-by: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> * add TODO back Co-authored-by: Jeffrey Rennie <rennie@google.com> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Leah E. Cole <6719667+leahecole@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com> Co-authored-by: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com>
Previous PR is here: #5
The previous PR was deleted because @dizcology suggested that using the auto-generated code samples can already serve our purpose and can also provide the benefits of easy maintainability. However, after reviewing our product documents, TPM and eng raised the concern that customers may feel confused about the linked code samples. The code sample construct the request in the code. But in reality, customers tend to construct the request in a json file. Thus they may find it hard to parse and use the json file without us showing them how to do it in code. This PR is to add a code snippet for the sync API that reads the request from a json file.