-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Fix #174: verify Entity.__repr__ logic #253
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
Instead, use '_key' directly, adding a '_must_key' property which raises a NoKey exception if None (for use in cases which require a key). Allows removal of the pylint 'maybe-no-member' comments.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
By using Thoughts? |
|
I'm using 'self._key' where I'm willing to allow for None, and 'self._must_key' where the method cannot proceed without one. I ditched using 'self.key()' within those methods for clarity and performance (de-confusing pylint was a nice bonus). I was avoiding having an opinion about #188 for the external API. That style seems common in JS land, but seems less "Pythonic" to me. Dunno that this PR should be hung up on that question, though. :) |
Incorporates feedback from @dhermes.
|
LGTM |
Fix #174: verify Entity.__repr__ logic
Event Location now works properly Bumped version
Event Location now works properly Bumped version
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
* chore: Update to gapic-generator-python 1.6.0 feat(python): Add typing to proto.Message based class attributes feat(python): Snippetgen handling of repeated enum field PiperOrigin-RevId: 487326846 Source-Link: googleapis/googleapis@da380c7 Source-Link: googleapis/googleapis-gen@61ef576 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjFlZjU3NjJlZTY3MzFhMGNiYmZlYTIyZmQwZWVjZWU1MWFiMWM4ZSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: new APIs added to reflect updates to the filestore service - Add ENTERPRISE Tier - Add snapshot APIs: RevertInstance, ListSnapshots, CreateSnapshot, DeleteSnapshot, UpdateSnapshot - Add multi-share APIs: ListShares, GetShare, CreateShare, DeleteShare, UpdateShare - Add ConnectMode to NetworkConfig (for Private Service Access support) - New status codes (SUSPENDED/SUSPENDING, REVERTING/RESUMING) - Add SuspensionReason (for KMS related suspension) - Add new fields to Instance information: max_capacity_gb, capacity_step_size_gb, max_share_count, capacity_gb, multi_share_enabled PiperOrigin-RevId: 487492758 Source-Link: googleapis/googleapis@5be5981 Source-Link: googleapis/googleapis-gen@ab0e217 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWIwZTIxN2Y1NjBjYzJjMWFmYzExNDQxYzJlYWI2YjY5NTBlZmQyYiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix docs build Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <[email protected]>
…253) Source-Link: https://togithub.com/googleapis/synthtool/commit/b4fe62efb5114b6738ad4b13d6f654f2bf4b7cc0 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:3bf87e47c2173d7eed42714589dc4da2c07c3268610f1e47f8e1a30decbfc7f1
* fix(deps): allow protobuf 3.19.5 * explicitly exclude protobuf 4.21.0
* docs: Add documentation for enums fix: Add context manager return types chore: Update gapic-generator-python to v1.8.1 PiperOrigin-RevId: 503210727 Source-Link: googleapis/googleapis@a391fd1 Source-Link: googleapis/googleapis-gen@0080f83 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDA4MGY4MzBkZWMzN2MzMzg0MTU3MDgyYmNlMjc5ZTM3MDc5ZWE1OCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Source-Link: https://togithub.com/googleapis/synthtool/commit/5f2a6089f73abf06238fe4310f6a14d6f6d1eed3 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:8555f0e37e6261408f792bfd6635102d2da5ad73f8f09bcb24f25e6afb5fac97
Source-Link: googleapis/synthtool@82f5cb2 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:5d8da01438ece4021d135433f2cf3227aa39ef0eaccc941d62aa35e6902832ae Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <[email protected]>
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 410253233 Source-Link: googleapis/googleapis@11e309d Source-Link: googleapis/googleapis-gen@b4f3403 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjRmMzQwM2EyOGNjOTljOWM3Y2Y0Y2QyZWZjYTEwNWYyNzlhM2IwZiJ9
🤖 I have created a release \*beep\* \*boop\* --- ## [2.8.0](https://www.github.com/googleapis/python-monitoring/compare/v2.7.0...v2.8.0) (2021-11-16) ### Features * Added support for auto-close configurations ([#253](https://www.github.com/googleapis/python-monitoring/issues/253)) ([0541c7a](https://www.github.com/googleapis/python-monitoring/commit/0541c7acc69465030077b5ce3b1d9c40cea7b634)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
🤖 I have created a release \*beep\* \*boop\* --- ## [2.6.0](https://www.github.com/googleapis/python-vision/compare/v2.5.0...v2.6.0) (2021-10-20) ### Features * add support for python 3.10 ([#253](https://www.github.com/googleapis/python-vision/issues/253)) ([7d5e27a](https://www.github.com/googleapis/python-vision/commit/7d5e27af26b13e1854c50f2ff7a7bdd7feea7b0a)) ### Documentation * **readme:** add pylint limitations ([#246](https://www.github.com/googleapis/python-vision/issues/246)) ([e4fb61f](https://www.github.com/googleapis/python-vision/commit/e4fb61f276f4540149884e8098fc4575f30ec9a6)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 459858846 Source-Link: googleapis/googleapis@21ef848 Source-Link: googleapis/googleapis-gen@26af3a3 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMjZhZjNhMzg0YmU0MDc3YzVmMDEwMDUyMWEyNjNmZDliZDhmYzdlNyJ9 PiperOrigin-RevId: 459095142 Source-Link: googleapis/googleapis@4f1be99 Source-Link: googleapis/googleapis-gen@ae686d9 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWU2ODZkOWNkZTRmYzNlMzZkMGFjMDJlZmI4NjQzYjE1ODkwYzFlZCJ9 feat: add audience parameter PiperOrigin-RevId: 456827138 Source-Link: googleapis/googleapis@23f1a15 Source-Link: googleapis/googleapis-gen@4075a85 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDA3NWE4NTE0ZjY3NjY5MWVjMTU2Njg4YTViYmYxODNhYTk4OTNjZSJ9
Source-Link: googleapis/synthtool@06e8279 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:b3500c053313dc34e07b1632ba9e4e589f4f77036a7cf39e1fe8906811ae0fce
* docs: Minor formatting chore: Update gapic-generator-python to v1.11.5 build: Update rules_python to 0.24.0 PiperOrigin-RevId: 563436317 Source-Link: googleapis/googleapis@42fd37b Source-Link: googleapis/googleapis-gen@280264c Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMjgwMjY0Y2EwMmZiOTMxNmI0MjM3YTk2ZDBhZjFhMjM0M2E4MWE1NiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Source-Link: https://togithub.com/googleapis/synthtool/commit/26c7505b2f76981ec1707b851e1595c8c06e90fc Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:f946c75373c2b0040e8e318c5e85d0cf46bc6e61d0a01f3ef94d8de974ac6790
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Includes generated unit tests, plumbing code unit tests, and system tests for determining whether a message is a resource, providing an accessor for one and only one path if it is a resource, and a service accessor for all message fields that are resources (only one level deep at the moment).
* feat: add support for Python 3.11 Signed-off-by: Daniel Ziegenberg <[email protected]> * add 3.11 to unit_test_python_versions * run post processor locally Signed-off-by: Daniel Ziegenberg <[email protected]> Co-authored-by: Anthonios Partheniou <[email protected]>
🤖 I have created a release \*beep\* \*boop\* --- ### [1.19.2](https://www.github.com/googleapis/proto-plus-python/compare/v1.19.1...v1.19.2) (2021-09-29) ### Bug Fixes * ensure enums are hashable ([#252](https://www.github.com/googleapis/proto-plus-python/issues/252)) ([232341b](https://www.github.com/googleapis/proto-plus-python/commit/232341b4f4902fba1b3597bb1e1618b8f320374b)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
…QLAlchemy 1.4 and higher (#253)
Source-Link: googleapis/synthtool@d52e638 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:4f9b3b106ad0beafc2c8a415e3f62c1a0cc23cabea115dbe841b848f581cfe99 Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
* chore(python): add .github/CODEOWNERS as a templated file Source-Link: googleapis/synthtool@c5026b3 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:0e18b9475fbeb12d9ad4302283171edebb6baf2dfca1bd215ee3b34ed79d95d7 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <[email protected]>
Source-Link: googleapis/synthtool@db94845 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:a8a80fc6456e433df53fc2a0d72ca0345db0ddefb409f1b75b118dfd1babd952 Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Lingqing Gan <[email protected]>
Source-Link: googleapis/synthtool@6fab84a Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe
* changes without context
autosynth cannot find the source of changes triggered by earlier changes in this
repository, or by version upgrades to tools such as linters.
* chore: fix Node.js TOC for cloud-rad
Source-Author: F. Hinkelmann <[email protected]>
Source-Date: Wed Oct 21 12:01:24 2020 -0400
Source-Repo: googleapis/synthtool
Source-Sha: 901ddd44e9ef7887ee681b9183bbdea99437fdcc
Source-Link: googleapis/synthtool@901ddd4
* chore(docs): update code of conduct of synthtool and templates
Source-Author: Christopher Wilcox <[email protected]>
Source-Date: Thu Oct 22 14:22:01 2020 -0700
Source-Repo: googleapis/synthtool
Source-Sha: 5f6ef0ec5501d33c4667885b37a7685a30d41a76
Source-Link: googleapis/synthtool@5f6ef0e
* docs: add proto-plus to intersphinx mapping
Source-Author: Tim Swast <[email protected]>
Source-Date: Tue Oct 27 12:01:14 2020 -0500
Source-Repo: googleapis/synthtool
Source-Sha: ea52b8a0bd560f72f376efcf45197fb7c8869120
Source-Link: googleapis/synthtool@ea52b8a
* fix(python_library): fix external unit test dependencies
I recently submitted https://github.com/googleapis/synthtool/pull/811/files, allowing external dependencies for unit tests. This fixes a small missing comma bug
Source-Author: Daniel Sanche <[email protected]>
Source-Date: Thu Oct 29 16:58:01 2020 -0700
Source-Repo: googleapis/synthtool
Source-Sha: 6542bd723403513626f61642fc02ddca528409aa
Source-Link: googleapis/synthtool@6542bd7
Co-authored-by: Christopher Wilcox <[email protected]>
This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/920075d4-7b9c-4b14-9957-7b33425ad95b/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) Source-Link: googleapis/synthtool@5b5bf6d
This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/920075d4-7b9c-4b14-9957-7b33425ad95b/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) Source-Link: googleapis/synthtool@5b5bf6d
This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/920075d4-7b9c-4b14-9957-7b33425ad95b/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) Source-Link: googleapis/synthtool@5b5bf6d
This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/920075d4-7b9c-4b14-9957-7b33425ad95b/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) Source-Link: googleapis/synthtool@5b5bf6d
This PR also removes use of the 'Entity.key()' getter/setter inside Entity methods, replacing with either the bare '_key' attribute, or a new '_must_key' property, and removes the pylint 'maybe-no-member' toggles.
Rework of #252.