-
Notifications
You must be signed in to change notification settings - Fork 55
Patch python SDK generator to read aiohttp response data #560
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughA conditional block was added to the Python REST client template to asynchronously read and attach the response body to the response object when handling exceptions involving Changes
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (8)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
config/clients/python/template/src/rest.py.mustache
(1 hunks)config/clients/python/template/test/rest_test.py.mustache
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (8)
- GitHub Check: build-and-test-java-sdk
- GitHub Check: build-and-test-python-sdk
- GitHub Check: build-and-test-go-sdk
- GitHub Check: build-and-test-js-sdk
- GitHub Check: build-and-test-dotnet-sdk
- GitHub Check: Analyze (javascript)
- GitHub Check: Analyze (go)
- GitHub Check: Analyze (actions)
🔇 Additional comments (2)
config/clients/python/template/test/rest_test.py.mustache (2)
6-6
: Import addition looks goodThe explicit
aiohttp
import is required for thespec=aiohttp.ClientResponse
mocks below. 👍
177-200
: Solid behavioural test – but update once the double-read guard is in placeThe test correctly asserts that:
- the response body is awaited exactly once, and
ValidationException
is raised withresponse.data
populated.After applying the guard suggested in
rest.py
, this test will still pass becauseread()
is awaited once (not twice). No changes needed here.Please re-run the test suite after patching
handle_response_exception
to confirm nothing regresses.
Applied coderrabit change
Summary
handle_response_exception
awaits aiohttp responses so that the response body is available during error handlingTesting
make test-client-python
(fails:docker: command not found
)https://chatgpt.com/codex/tasks/task_e_684ffad4696883229e03bdb7a6ff13ea
Summary by CodeRabbit
Bug Fixes
Tests