Skip to content

MLE-20906 : Update Node Client based on changes to functions in Optic #936

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

Merged
merged 1 commit into from
Jul 3, 2025

Conversation

anu3990
Copy link
Contributor

@anu3990 anu3990 commented Jul 2, 2025

No description provided.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the Node client tests and generated types to align with changed Optic vector functions.

  • Refresh license headers and normalize string quotes in generated test files
  • Adjust test logic: rename functions, update expected vector results, and add a new vectorScore#4 case
  • Introduce a new ServerNode type and export in the server-types-generated module

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
test-basic/plan-builder-generated.js Updated license header; revised vectorScore tests and expected outputs; added vec.vectorScore#4
test-basic/optic-vector.js Fixed typo, renamed tests from cosineSimilarity to cosine, adjusted expected values, added cosineDistance
lib/server-types-generated.js Updated license header, added ServerNode class, and updated module.exports
Comments suppressed due to low confidence (3)

test-basic/plan-builder-generated.js:1768

  • Consider adding a version check and skipping this test for server versions below 12 to match the pattern in previous vectorScore tests and prevent failures on older servers.
    it('vec.vectorScore#4', function(done) {

lib/server-types-generated.js:47

  • The inserted closing brace here appears unmatched and could introduce a syntax error. It should be removed or its placement adjusted to maintain proper block structure.
}

lib/server-types-generated.js:718

  • [nitpick] Align the indentation of 'ServerNode: ServerNode,' with the other exports for consistent formatting.
ServerNode: ServerNode,

rjrudin
rjrudin previously approved these changes Jul 3, 2025
* @param { VecVector } [vector2] - The vector from which to calculate the cosine with vector1.
* @returns { XsDouble }
*/
cosine(...args) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just an FYI for the release notes, and this will apply for the Java Client as well - we'll need to call out that the method name changed here, but we're not considering that a breaking change since the addition of these vector functions was part of a "tech preview" for release for the server.

@anu3990
Copy link
Contributor Author

anu3990 commented Jul 3, 2025

Updated vectorScore tests as suggested by Lazaro.

@anu3990 anu3990 requested a review from rjrudin July 3, 2025 19:28
@anu3990 anu3990 merged commit f57dc15 into marklogic:develop Jul 3, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants