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
feat: support autoconversion of Entity to Key for purposes of delete & delete_multi #123
feat: support autoconversion of Entity to Key for purposes of delete & delete_multi #123
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.
LGTM
+ ":class:`google.cloud.datastore.entity.Entity`." | ||
) | ||
warnings.warn(message, UserWarning) | ||
key = key.key |
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.
- [L683] This works but may result in occasional snarky comments. I would not, however, rewrite it as
key = getattr(key, 'key')
cuz that's worse. - [L646] Would any changes be req'd in this part of the docstring?
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.
may result in occasional snarky comments.
@wescpy I don't quite understand. Could you elaborate.
As for docstr, that is part of the open conversation. We can either
- make this a stealth change to help smooth migration. As written with the warning, I wouldn't want to add to docs
- say this is actually supported, in which case, no warning should happen, but we should specify in types you can hand an entity as well.
I would be fine to call this supported, but started from the 'smoothing' over as lightest touch.
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.
Snarky meaning some people may criticize naming choice in key = key.key
while it's perfectly valid IMO. Anyway, it was an aside and a mostly irrelevant comment... pls ignore. For the other one, I'm leaning #2. I'd also like to hear from members of the community as well, esp. those who work w/Datastore regularly. In particular, I'd like to know whether this is something they find useful.
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.
Needs unit tests for this feature.
Co-authored-by: Tres Seaver <tseaver@palladion.com>
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
@tseaver sort of waiting until we agree if to go with full support or sneaky support. Do you have an opinion? I am not terrified about adding type coercion myself, and this will make migration from NDB a bit smoother. |
@crwilcox I would actually go with full support (no warning, update the docstring). |
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
feedback addressed. LGTM elsewhere ;)
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.
LGTM
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.
LGTM
Fixes #122
Can discuss if we should
or
Entity