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

fix js tests, fix bug with index deletion #261

Merged
merged 3 commits into from
Mar 30, 2023
Merged

fix js tests, fix bug with index deletion #261

merged 3 commits into from
Mar 30, 2023

Conversation

jeffchuber
Copy link
Contributor

This PR

  • fixes our JS tests - they had grown out of date. And we do need to add them to CI! (not addressed in this PR)
  • fixes a bug where _delete_index relied on the collection still existing but it was deleted before _delete_index ran. This flips the order.

@@ -220,14 +220,14 @@ def delete_collection(self, name: str):
"""
)

self._delete_index(collection_uuid)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we add a python test for delete collection? I assume this was error'ing before?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I'd like to land that after this if that is ok

Copy link
Collaborator

Choose a reason for hiding this comment

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

I've added a test now.

@@ -136,7 +136,8 @@ test('it should peek a collection', async () => {
const results = await collection.peek(2)
expect(results).toBeDefined()
expect(results).toBeInstanceOf(Object)
expect(results.embeddings.length).toBe(2)
console.log('results', results)
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit remove?

@@ -118,7 +118,7 @@ test('it should query a collection', async () => {
const results = await collection.query([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 2)
expect(results).toBeDefined()
expect(results).toBeInstanceOf(Object)
expect(results.embeddings[0].length).toBe(2)
// expect(results.embeddings[0].length).toBe(2)
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit remove?

@HammadB
Copy link
Collaborator

HammadB commented Mar 30, 2023

I think we should add a python test for delete as well i.f.f python is broken. Please release after this, i am assuming the index refactor broke delete as well. Which is bad.

@HammadB
Copy link
Collaborator

HammadB commented Mar 30, 2023

I've added a test, feel free to merge when tests pass.

@HammadB HammadB closed this Mar 30, 2023
@HammadB HammadB reopened this Mar 30, 2023
@jeffchuber jeffchuber merged commit 9559eba into main Mar 30, 2023
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