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
fix: Add type hints for KMS snippets #9979
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.
Great work. Thank you.
I have one request which applies to all samples that require a new import outside of the sample function:
- Please make sure the region tag includes the imports and avoids duplication (i.e. importing kms again inside the function). Otherwise if someone c&p the sample from c.g.c. it will fail without the import.
- Optionally as this is more cumbersome, we could move out all imports from sample function and keep them together in the top of the file.
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.
Approving, assuming @rsamborski 's comments are addressed
…atform/python-docs-samples into fixit-glasnt-typehints-kms
I was using |
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.
Thanks. Approved.
* fix: Add type hints for KMS snippets * fix: type * fix: even more types * black * fix: remove debugging note * isort * manual sort, apparently * Move all imports to top of files, sort, move region tags * even more import fixes * black, isort * black, again
* fixit: Add type-hints to Python sample at functions/ocr/app * Fixing stuff * Fixing stuff * Enforcing type checks * Enforcing type checks * Fixing any typing * chore(deps): update dependency shapely to v2 (#10004) * Adding deletion of rows with NULL dag_id (#10002) Co-authored-by: Charles Engelke <engelke@google.com> * fixit: add type-hints to functions/v2/ocr (#9980) b/280879671 ## Description Fixes b/280879671 Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google. ## Checklist - [ ] I have followed [Sample Guidelines from AUTHORING_GUIDE.MD](https://togithub.com/GoogleCloudPlatform/python-docs-samples/blob/main/AUTHORING_GUIDE.md) - [ ] README is updated to include [all relevant information](https://togithub.com/GoogleCloudPlatform/python-docs-samples/blob/main/AUTHORING_GUIDE.md#readme-file) - [ ] **Tests** pass: `nox -s py-3.9` (see [Test Environment Setup](https://togithub.com/GoogleCloudPlatform/python-docs-samples/blob/main/AUTHORING_GUIDE.md#test-environment-setup)) - [ ] **Lint** pass: `nox -s lint` (see [Test Environment Setup](https://togithub.com/GoogleCloudPlatform/python-docs-samples/blob/main/AUTHORING_GUIDE.md#test-environment-setup)) - [ ] These samples need a new **API enabled** in testing projects to pass (let us know which ones) - [ ] These samples need a new/updated **env vars** in testing projects set to pass (let us know which ones) - [ ] This sample adds a new sample directory, and I updated the [CODEOWNERS file](https://togithub.com/GoogleCloudPlatform/python-docs-samples/blob/main/.github/CODEOWNERS) with the codeowners for this sample - [ ] This sample adds a new **Product API**, and I updated the [Blunderbuss issue/PR auto-assigner](https://togithub.com/GoogleCloudPlatform/python-docs-samples/blob/main/.github/blunderbuss.yml) with the codeowners for this sample - [ ] Please **merge** this PR for me once it is approved * [DLP] Implemenetd dlp_inspect_image_listed_infotypes with unit test cases (#9872) ## Description Implemenetd dlp_inspect_image_listed_infotypes with unit test cases. Java equivalent: https://cloud.google.com/dlp/docs/samples/dlp-inspect-image-listed-infotypes#dlp_inspect_image_listed_infotypes-java Fixes #<ISSUE-NUMBER> Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google. ## Checklist - [X] I have followed [Sample Guidelines from AUTHORING_GUIDE.MD](https://togithub.com/GoogleCloudPlatform/python-docs-samples/blob/main/AUTHORING_GUIDE.md) - [ ] README is updated to include [all relevant information](https://togithub.com/GoogleCloudPlatform/python-docs-samples/blob/main/AUTHORING_GUIDE.md#readme-file) - [X] **Tests** pass: `nox -s py-3.9` (see [Test Environment Setup](https://togithub.com/GoogleCloudPlatform/python-docs-samples/blob/main/AUTHORING_GUIDE.md#test-environment-setup)) - [X] **Lint** pass: `nox -s lint` (see [Test Environment Setup](https://togithub.com/GoogleCloudPlatform/python-docs-samples/blob/main/AUTHORING_GUIDE.md#test-environment-setup)) - [ ] These samples need a new **API enabled** in testing projects to pass (let us know which ones) - [ ] These samples need a new/updated **env vars** in testing projects set to pass (let us know which ones) - [ ] This sample adds a new sample directory, and I updated the [CODEOWNERS file](https://togithub.com/GoogleCloudPlatform/python-docs-samples/blob/main/.github/CODEOWNERS) with the codeowners for this sample - [ ] This sample adds a new **Product API**, and I updated the [Blunderbuss issue/PR auto-assigner](https://togithub.com/GoogleCloudPlatform/python-docs-samples/blob/main/.github/blunderbuss.yml) with the codeowners for this sample - [X] Please **merge** this PR for me once it is approved * chore(deps): update dependency structlog to v22.3.0 (#8540) Co-authored-by: Charles Engelke <engelke@google.com> * fixit: update docstrings for Cloud Run samples (#10007) * chore: update docstrings for Cloud Run samples * lint * Update render.py * fix: Add type hints for KMS snippets (#9979) * fix: Add type hints for KMS snippets * fix: type * fix: even more types * black * fix: remove debugging note * isort * manual sort, apparently * Move all imports to top of files, sort, move region tags * even more import fixes * black, isort * black, again * Fixing typing info * Trying to fix typing --------- Co-authored-by: Charles Engelke <engelke@google.com> Co-authored-by: Mend Renovate <bot@renovateapp.com> Co-authored-by: kubasieron <89135874+kubasieron@users.noreply.github.com> Co-authored-by: Avani-Thakker-Crest <129363704+Avani-Thakker-Crest@users.noreply.github.com> Co-authored-by: Averi Kitsch <akitsch@google.com> Co-authored-by: Katie McLaughlin <katie@glasnt.com> Co-authored-by: Karl Weinmeister <11586922+kweinmeister@users.noreply.github.com>
Description
Fixes b/280879322
Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.
Checklist
nox -s py-3.9
(see Test Environment Setup)nox -s lint
(see Test Environment Setup)