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

Unable to exclude large indexes #1242

Closed
dogmatic69 opened this issue Mar 21, 2024 · 1 comment
Closed

Unable to exclude large indexes #1242

dogmatic69 opened this issue Mar 21, 2024 · 1 comment
Assignees
Labels
api: datastore Issues related to the googleapis/nodejs-datastore API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@dogmatic69
Copy link

Thanks for stopping by to let us know something could be better!

PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.

  1. Is this a client library issue or a product issue?
    client lib

  2. Did someone already solve this?
    existing feature that is broken

  3. Do you have a support contract?
    no

Environment details

  • OS: Alpine
  • Node.js version: 21.7.1
  • yarn: 1.22.19
  • @google-cloud/datastore version: 8.5.0

Steps to reproduce

in the code, when passing data with the name/value format rather than a normal object, this functionality seems to be completely skipped.

Simple save function with the excludeLargeProperties prop hard coded to true results in error that a field is too large. Given the prop is true, I'd expect it to ignore any large fields.

Feasible to include this functionality or do I avoid using the verbose data structure when saving?

await instance.save({
  key,
  data: [
    {
      name: 'field_a',
      value: 'value_a',
    },
    {
      name: 'field_b',
      value: {
        nested_field: 'nested_value', // completely ignored
      },
    }
  ],
  excludeLargeProperties: true,
})

The above code with a suitably large field results in errors like this

Error saving data: 3 INVALID_ARGUMENT: The value of property "content" is longer than 1500 bytes. Error: 3 INVALID_ARGUMENT: The value of property "content" is longer than 1500 bytes.
    at callErrorFromStatus (/app/node_modules/@grpc/grpc-js/build/src/call.js:31:19)
    at Object.onReceiveStatus (/app/node_modules/@grpc/grpc-js/build/src/client.js:192:76)
    at Object.onReceiveStatus (/app/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:360:141)
    at Object.onReceiveStatus (/app/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:323:181)
    at /app/node_modules/@grpc/grpc-js/build/src/resolving-call.js:99:78
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
for call at
    at ServiceClientImpl.makeUnaryRequest (/app/node_modules/@grpc/grpc-js/build/src/client.js:160:32)
    at ServiceClientImpl.<anonymous> (/app/node_modules/@grpc/grpc-js/build/src/make-client.js:105:19)
    at /app/node_modules/@google-cloud/datastore/build/src/v1/datastore_client.js:232:29
    at /app/node_modules/google-gax/build/src/normalCalls/timeout.js:44:16
    at OngoingCall.call (/app/node_modules/google-gax/build/src/call.js:67:27)
    at NormalApiCaller.call (/app/node_modules/google-gax/build/src/normalCalls/normalApiCaller.js:34:19)
    at /app/node_modules/google-gax/build/src/createApiCall.js:108:30
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
@dogmatic69 dogmatic69 added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Mar 21, 2024
@product-auto-label product-auto-label bot added the api: datastore Issues related to the googleapis/nodejs-datastore API. label Mar 21, 2024
@danieljbruce
Copy link
Contributor

#1266 solves this issue

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. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

2 participants