Skip to content

fix: return synchronous API responses directly - #1337

Open
FU-max-boop wants to merge 1 commit into
qdrant:devfrom
FU-max-boop:fix/api-client-request-sync
Open

fix: return synchronous API responses directly#1337
FU-max-boop wants to merge 1 commit into
qdrant:devfrom
FU-max-boop:fix/api-client-request-sync

Conversation

@FU-max-boop

Copy link
Copy Markdown

All Submissions:

  • Contributions target the dev branch.
  • I followed the repository contribution guidance.
  • I checked for other open pull requests for the same change.

Changes to Core Features:

  • The change and motivation are explained below.
  • Regression tests cover the core change.
  • Relevant tests pass locally.

Summary

Fixes #1336.

ApiClient.request_sync() previously passed the result of the synchronous ApiClient.request() to asyncio.run_until_complete(). Successful dictionary responses and None responses were therefore rejected with TypeError because they are not awaitable.

The synchronous wrapper now directly returns self.request(...). AsyncApiClient.request_sync() is intentionally unchanged because its request() method is a coroutine and still needs the event-loop bridge.

Validation

  • red-to-green regression for typed dictionary and type_=None responses: 2 passed
  • Ruff check and format check on changed Python files
  • focused mypy check for the new test
  • git diff --check
  • duplicate search across open and closed issues/PRs

AI assistance was used to reproduce the sync/async drift, review edge cases, and draft tests; every changed line and test result was manually verified.

@netlify

netlify Bot commented Aug 13, 2026

Copy link
Copy Markdown

Deploy Preview for poetic-froyo-8baba7 ready!

Name Link
🔨 Latest commit 14508ff
🔍 Latest deploy log https://app.netlify.com/projects/poetic-froyo-8baba7/deploys/6a7d50503a77c70008b7fc36
😎 Deploy Preview https://deploy-preview-1337--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 project configuration.

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 364c0e74-0dc2-419d-bdf5-606ae54a640f

📥 Commits

Reviewing files that changed from the base of the PR and between f003e6c and 14508ff.

📒 Files selected for processing (2)
  • qdrant_client/http/api_client.py
  • tests/test_api_client.py

📝 Walkthrough

Walkthrough

ApiClient.request_sync now returns self.request(...) directly instead of running the result through an event loop. Parameterized tests cover dictionary and None responses, verify the exact request call, and close the client.

Estimated code review effort: 2 (Simple) | ~10 minutes

Mergeability Score: ⚪ Minimal · up to 14508

This localized change makes synchronous API calls return successful dictionary and None responses directly, with regression coverage for both cases; no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: joein

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the fix to return synchronous API responses directly.
Description check ✅ Passed The description explains the synchronous response bug, implementation, scope, and regression tests.
Linked Issues check ✅ Passed The change directly satisfies issue #1336 and adds coverage for dictionary and None responses.
Out of Scope Changes check ✅ Passed The implementation and tests are focused on the linked issue with no unrelated changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant