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

Removed invalid await from grpc async call #785

Merged
merged 2 commits into from
Sep 24, 2024

Conversation

VanaMartin
Copy link
Contributor

All Submissions:

  • Contributions should target the dev branch. Did you create your branch from dev?
  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Changes to Core Features:

This PR only removes invalid await clause from initialising grpc request. The existing await was causing folowing exception (on version 1.11.2):

   2597     if isinstance(shard_key, get_args_subscribed(models.ShardKey)):
   2598         shard_key = RestToGrpc.convert_shard_key(shard_key)
-> 2599     request = await grpc.CreateShardKey(
   2600         shard_key=shard_key,
   2601         shards_number=shards_number,
   2602         replication_factor=replication_factor,
   2603         placement=placement or [],
   2604     )
   2605     return (
   2606         await self.grpc_collections.CreateShardKey(
   2607             grpc.CreateShardKeyRequest(
   (...)
   2611         )
   2612     ).result
   2613 else:

TypeError: object CreateShardKey can't be used in 'await' expression

I've tested the local behaviour with a positive result.

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Copy link

netlify bot commented Sep 24, 2024

Deploy Preview for poetic-froyo-8baba7 ready!

Name Link
🔨 Latest commit bb5fd65
🔍 Latest deploy log https://app.netlify.com/sites/poetic-froyo-8baba7/deploys/66f2e89a07687b0008dab419
😎 Deploy Preview https://deploy-preview-785--poetic-froyo-8baba7.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@joein
Copy link
Member

joein commented Sep 24, 2024

Hi @VanaMartin

Thank you for your contribution

However, we can't accept it right now, because async client is auto-generated from sync client and changes to async files can't be done without altering either sync client or generator code

We'll investigate the issue

@joein
Copy link
Member

joein commented Sep 24, 2024

I have found and fixed the issue and extended tests coverage

@joein joein requested review from joein and coszio September 24, 2024 16:41
@joein joein merged commit 8ad5574 into qdrant:dev Sep 24, 2024
9 checks passed
joein added a commit that referenced this pull request Sep 24, 2024
* Removed invalid await from grpc async call

* fix: fix generation of grpc async create shard key, add tests

---------

Co-authored-by: George Panchuk <[email protected]>
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