-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Adding lazy loading support for datastore connection. #668
Conversation
:param name: The name of the attribute / property being evaluated. | ||
|
||
:type method: callable that takes no arguments | ||
:param method: The method used to evaluate the property. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
The last commit LGTM, except for my note about the |
Done via: - Moving `_add_keys_to_request` definition to connection module - Removing only other use (in `batch`, was not a list of keys) - Copying `_prepare_key_for_request` from helpers (googleapis#528 would be nice, since we could just remove `_prepare_key_for_request` all together)
Moved from datastore.__init__.
fa04127
to
7b0fc6e
Compare
@tseaver PTAL I rebased on top of #667. Your Also the commit you LGTM'd changed slightly since I changed #667 to use a decorator for lazy properties |
@@ -189,8 +189,8 @@ def delete(self, key): | |||
if not _dataset_ids_equal(self._dataset_id, key.dataset_id): | |||
raise ValueError("Key must be from same dataset as batch") | |||
|
|||
key_pb = key.to_protobuf() | |||
helpers._add_keys_to_request(self.mutation.delete, [key_pb]) | |||
key_pb = helpers._prepare_key_for_request(key.to_protobuf()) |
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.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
I've got to run, won't be able to finish review tonight. :( |
No worries |
@tseaver After this is in I'd like to cut |
OK, LGTM. 0.4.2 would be fine, as well. |
Adding lazy loading support for datastore connection.
* feat: added speech endpointing setting feat: added Knowledge Search API PiperOrigin-RevId: 560215389 Source-Link: googleapis/googleapis@b1666e6 Source-Link: googleapis/googleapis-gen@07e82b4 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDdlODJiNGQ0OTE3NDk0ZDg1MDM5NzIyZjY3M2Q0MDljNGM3MzA1ZiJ9 * 🦉 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>
NOTE: Has #667 as diffbase.
Happens in 4 phases:
datastore.helpers
import inconnection
. (this would have caused a cycle ifConnection
was used in_implicit_environ
)get_connection()
fromdatastore.__init__
to_implicit_environ
.set_default_connection()
fromdatastore.__init__
to_implicit_environ
.Note that I had to copy
_prepare_key_for_request
fromhelpers
intoconnection
to avoid cyclic imports (#528 would be nice, since we could just remove_prepare_key_for_request
all together)