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

Refactor listPaginated tests + make README clearer #312

Merged
merged 4 commits into from
Nov 1, 2024

Conversation

aulorbe
Copy link
Collaborator

@aulorbe aulorbe commented Oct 31, 2024

Problem

The core DB previously had a race-condition bug that resulted in pagination tokens being non-deterministically returned to the user when they'd call the listPaginated endpoint (not just in the TS client).

Solution

The core DB team has fixed this bug. Now that it's fixed, this PR updates previously-commented-out tests + updates the README to be more precise regarding how this method works.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Infrastructure change (CI configs, etc)
  • Non-code change (docs, etc)
  • None of the above: (explain here)

Test Plan

CI passes.


@aulorbe aulorbe marked this pull request as ready for review October 31, 2024 21:06
@aulorbe
Copy link
Collaborator Author

aulorbe commented Oct 31, 2024

(Current CI failures are due to known-flakiness on the integration tests for bulkImport; can ignore, I have a ticket to address asap.)

Copy link

@haruska haruska left a comment

Choose a reason for hiding this comment

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

👍

README.md Outdated
@@ -945,11 +959,20 @@ console.log(results);
// usage: { readUnits: 1 }
// }

// Fetch the next page of results
await index.listPaginated({
// Grab the final vector ID matching prefix 'doc1#' using the paginationToken returned by the previous call
Copy link

Choose a reason for hiding this comment

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

Nit: "Fetch" is a verb we use elsewhere. "Get" might also make sense given the http verb. I'd avoid "Grab"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah okay thanks, I'll change to fetch!

Copy link
Contributor

@austin-denoble austin-denoble left a comment

Choose a reason for hiding this comment

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

🚢

README.md Outdated

- When you do not specify a `prefix`, the default prefix is an empty string, which returns all vector IDs
in your index
- There is a hard limit of `300` vector IDs if no `limit` is specified. Consequently, if there are fewer than `300`
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it default to 300 or is that the limit? I had thought the default was 100. 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In the core DB code, the limit is 300. Let me test it out personally and get back to you (maybe the API limits it to 100).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah fantastic catch @austin-denoble ! It is 100 on the API side now. I will change :)

@aulorbe aulorbe merged commit 92b7e66 into main Nov 1, 2024
19 checks passed
@aulorbe aulorbe deleted the update-listpaginated branch November 1, 2024 18:46
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.

3 participants