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

feature: remove _ClusterBatch #1259

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

tibor-reiss
Copy link
Contributor

Fixes #1097

Copied also the test_cluster.py from integration_v3

@weaviate-git-bot
Copy link

Great to see you again! Thanks for the contribution.

beep boop - the Weaviate bot 👋🤖

PS:
Are you already a member of the Weaviate Slack channel?

@tibor-reiss
Copy link
Contributor Author

tibor-reiss commented Aug 28, 2024

1 test error in integration_v3/test_batch.py::test_add_1000_objects_with_async_indexing_and_wait, the rest is because the workflows were cancelled. Probably some timing issue, because code change does not affect v3, and it works locally.

@tibor-reiss
Copy link
Contributor Author

Hi @tsmith023, what do you think, is this the right approach, please?

Copy link
Contributor

@tsmith023 tsmith023 left a comment

Choose a reason for hiding this comment

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

I'm not sure why your tests are all timing out 🤔 It could be something to do with the resources so if you can make these changes then we'll rerun the tests to see!

Comment on lines 17 to 21
def client():
client = weaviate.connect_to_local()
client.collections.delete_all()
yield client
client.collections.delete_all()
Copy link
Contributor

Choose a reason for hiding this comment

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

You need to call client.close() once done with it so that resources can be cleaned up gracefully, cheers!

Copy link
Collaborator

Choose a reason for hiding this comment

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

you cannot delete all other classes here - other tests are running concurrently and you will delete their data while the test is running.

v3 tests are running sequentially, so it is not a problem there.

The flow should be:

  • delete collection for specific test (in case there were leftovers)
  • create collection
  • do test things
  • delete collection

Copy link
Contributor Author

@tibor-reiss tibor-reiss Aug 29, 2024

Choose a reason for hiding this comment

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

Thanks for feedback, I was not aware that tests run in parallel in v4, refactored accordingly.

Comment on lines 57 to 59
server_is_at_least_124 = parse_version_string(
client.get_meta()["version"]
) > parse_version_string("1.24")
Copy link
Contributor

Choose a reason for hiding this comment

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

The client has this capability as client._connection._weaviate_version.is_at_least(1, 24, 0) so it would be preferable to use that here, cheers!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, done

Comment on lines +80 to +84
async def rest_nodes(
self,
collection: Optional[str] = None,
output: Optional[Literal["minimal", "verbose"]] = None,
) -> List[NodeREST]:
Copy link
Contributor

Choose a reason for hiding this comment

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

Since you are adding this method to _ClusterAsync, you also need to add its synchronous equivalent signature to the sync stubs in collections/cluster/sync.pyi alongside the stubs for the def nodes(...) method, cheers!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done as well

@tibor-reiss tibor-reiss requested a review from a team as a code owner August 29, 2024 18:29
@tsmith023
Copy link
Contributor

@tibor-reiss, removing docker-compose-rerank.yml from the CI makes sense since (I think, you should check) we don't use it but you will need to remove its referenced port from here: https://github.com/weaviate/weaviate-python-client/blob/main/ci/compose.sh#L24, as this is causing the tests to all fail. Cheers!

@tsmith023
Copy link
Contributor

@tibor-reiss, the problem with all the tests failing is actually an issue with our CI pipeline. We'll try to get it fixed ASAP to unblock you (and us too)

@tibor-reiss
Copy link
Contributor Author

@tsmith023 Sorry, I made a silly mistake removing the docker file - these rerank images did not come up locally, so I deleted it for local testing (together with the port change you also mentioned) and forgot to uncommit. I have put it back now for this PR.

Though if it's not needed, it would definitely make sense to remove it :)

@tsmith023
Copy link
Contributor

@tibor-reiss, the fix for the broken CI jobs has been merged into main. Could you pull those changes onto your branch and then we can rerun the tests? Cheers!

@tibor-reiss
Copy link
Contributor Author

@tibor-reiss, the fix for the broken CI jobs has been merged into main. Could you pull those changes onto your branch and then we can rerun the tests? Cheers!

Master is merged now 🤞

@tibor-reiss
Copy link
Contributor Author

@tsmith023 friendly reminder: please check if this works (rebased onto main again just now)

@tibor-reiss
Copy link
Contributor Author

@tsmith023 hmmm, still timing out it seems...

@tibor-reiss
Copy link
Contributor Author

Friendly ping @tsmith023 @dirkkul

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.

Refactor batch logic to use _Cluster instead of _ClusterBatch
4 participants