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

Add warning when inference used for Number types to Datastore types #759

Open
crwilcox opened this issue Nov 18, 2020 · 2 comments
Open
Labels
api: datastore Issues related to the googleapis/nodejs-datastore API. help wanted We'd love to have community involvement on this issue. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@crwilcox
Copy link
Contributor

As discussed in #754, the auto conversion to datastore types doesn't work particualrly well in Node.js. Numbers need to be coverted to int, double, but there are times it makes the wrong choice.

This functionality is planned to be removed in a future version as it is too easy for customers to do the wrong thing and end up with disparate types unexpectedly.

Example
Insert "3.0", "3.99", "4.99" expecting double, double, double. Actual is int, double, double, as 3.0 is an integer.

This issue tracks adding a warning in a fix release letting customers know that inference is being used and can be fragile, particularly if used for columns expected to be floats/doubles.

@product-auto-label product-auto-label bot added the api: datastore Issues related to the googleapis/nodejs-datastore API. label Nov 18, 2020
@crwilcox crwilcox added the help wanted We'd love to have community involvement on this issue. label Nov 18, 2020
@yoshi-automation yoshi-automation added triage me I really want to be triaged. 🚨 This issue needs some love. labels Nov 19, 2020
@crwilcox
Copy link
Contributor Author

crwilcox commented Dec 4, 2020

I think we are going to decide to not warn, but just remove this functionality as stated in #760.

@crwilcox crwilcox closed this as completed Dec 4, 2020
@crwilcox crwilcox added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Dec 4, 2020
@slo-stat-bot slo-stat-bot bot removed the 🚨 This issue needs some love. label Dec 4, 2020
@crwilcox crwilcox reopened this Dec 8, 2020
@yoshi-automation yoshi-automation removed the triage me I really want to be triaged. label Dec 8, 2020
@crwilcox
Copy link
Contributor Author

crwilcox commented Dec 9, 2020

Warning is less breaking to users than deprecation, and customers that use ints only will not experience the degraded experience. This warning is a smaller step and directs users to the source of inconsistent types in their node code.

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. help wanted We'd love to have community involvement on this issue. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
2 participants