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

Support return Long for int64 type #279

Merged
merged 4 commits into from
Feb 22, 2024
Merged

Support return Long for int64 type #279

merged 4 commits into from
Feb 22, 2024

Conversation

shanghaikid
Copy link
Contributor

In this pr

  • I add a loaderOptions in ClientConfig, it controls protobuf.js how to parse int64

The default loader options is

const LOADER_OPTIONS = {
  keepCase: true, // preserve field names
  longs: String, // convert int64 fields to strings
  enums: String, // convert enum fields to strings
  defaults: true, // populate default values
  oneofs: true, // populate oneof fields
};

If user want the sdk to return real int64 data, user can change it to this:

const longClient = new MilvusClient({
  address: IP,
  loaderOptions: { longs: Function },
});
  • I updated the test functions to support int64 verification
  • I upgrade grpc packages
  • I add the long.js package as dev dependency.

Signed-off-by: ryjiang <jiangruiyi@gmail.com>
Signed-off-by: ryjiang <jiangruiyi@gmail.com>
Signed-off-by: ryjiang <jiangruiyi@gmail.com>
@sre-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: shanghaikid

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@shanghaikid
Copy link
Contributor Author

this related to #279 226

Signed-off-by: ryjiang <jiangruiyi@gmail.com>
Copy link

codecov bot commented Feb 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b2d913b) 96.62% compared to head (cd092ba) 96.63%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #279   +/-   ##
=======================================
  Coverage   96.62%   96.63%           
=======================================
  Files          36       36           
  Lines        1865     1870    +5     
  Branches      461      461           
=======================================
+ Hits         1802     1807    +5     
  Misses         58       58           
  Partials        5        5           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@shanghaikid shanghaikid merged commit 5458c15 into main Feb 22, 2024
4 of 5 checks passed
@shanghaikid shanghaikid deleted the int64 branch February 22, 2024 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants