Skip to content
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

Don't unwrap automatically for Number to Datastore Types #760

Open
crwilcox opened this issue Nov 18, 2020 · 4 comments
Open

Don't unwrap automatically for Number to Datastore Types #760

crwilcox opened this issue Nov 18, 2020 · 4 comments
Labels
api: datastore Issues related to the googleapis/nodejs-datastore API. next major: breaking change this is a change that we should wait to bundle into the next major version priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@crwilcox
Copy link
Contributor

crwilcox commented Nov 18, 2020

Related to #754, #759

Remove auto inference of Numbers. This is a 'foot-gun' in the library and we should encourage usage of datastore.double and datastore.int so the library doesn't choose poorly.

This is for sure used in Save and Query today.

Note: breaking change.

@product-auto-label product-auto-label bot added the api: datastore Issues related to the googleapis/nodejs-datastore API. label Nov 18, 2020
@vicb
Copy link
Contributor

vicb commented Nov 18, 2020

It would be nice to create a migration path for DB created before inference is removed.

In such DB there could be a mix of integer/float for the same property and datastore.double / datastore.int would only apply to numbers created after the inference is removed.

@yoshi-automation yoshi-automation added triage me I really want to be triaged. 🚨 This issue needs some love. labels Nov 19, 2020
@crwilcox crwilcox added priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. help wanted We'd love to have community involvement on this issue. labels Dec 1, 2020
@yoshi-automation yoshi-automation removed the triage me I really want to be triaged. label Dec 1, 2020
@crwilcox crwilcox added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. priority: p3 Desirable enhancement or fix. May not be included in next release. and removed priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. help wanted We'd love to have community involvement on this issue. labels Dec 8, 2020
@crwilcox
Copy link
Contributor Author

crwilcox commented Dec 8, 2020

Going to block on this happening for a bit. Warning may be enough and is in PR, tracked by 759.

@yoshi-automation yoshi-automation removed the 🚨 This issue needs some love. label Dec 8, 2020
@crwilcox crwilcox changed the title Remove Number to Datastore Type inference from save and query. Don't unwrap automatically for Number to Datastore Types Dec 12, 2020
@crwilcox
Copy link
Contributor Author

I am rewording this as the approach has moved from removal to changing the default behavior. By default we shouldn't unwrap these. Int and Double , as of the pr (773) extend Number. Keeping them wrapped should cause no/minimal friction, but allow us to still have additional data about the type in datastore.

@crwilcox crwilcox removed the type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. label Dec 12, 2020
@meredithslota meredithslota added the next major: breaking change this is a change that we should wait to bundle into the next major version label Nov 8, 2023
@meredithslota
Copy link
Contributor

Reconsider the approach (back to removal) — added thenext major: breaking change label to ensure we don't miss it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the googleapis/nodejs-datastore API. next major: breaking change this is a change that we should wait to bundle into the next major version priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

4 participants