Add QuantConnect connector framework#65
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 550b853234
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| except urllib.error.HTTPError as exc: | ||
| status_code = int(exc.code) | ||
| raw_body = exc.read() | ||
| parsed_error = _parse_response_body(raw_body) |
There was a problem hiding this comment.
Handle non-JSON HTTP error bodies without crashing
In the HTTPError path, the code unconditionally calls _parse_response_body(raw_body), but many gateways/proxies return HTML or empty bodies on 4xx/5xx responses; in those cases json.loads raises and callers receive a decode exception instead of QuantConnectApiError with the HTTP status. That breaks normal API error handling/retry logic exactly when the service is degraded, so this branch should tolerate parse failure and still raise QuantConnectApiError.
Useful? React with 👍 / 👎.
| if raw_body is None or raw_body == b"" or raw_body == "": | ||
| return {} |
There was a problem hiding this comment.
Reject empty 2xx responses from QuantConnect API
Returning {} for an empty response body makes post_json treat a 2xx response as success unless success is explicitly False, so truncated/invalid responses can silently pass through (for example, deploy calls can return no deployId without raising). Since the API contract documents object responses with a success field, empty bodies should be treated as protocol errors and surfaced as QuantConnectApiError.
Useful? React with 👍 / 👎.
Summary
Verification
Full local pytest collection is blocked on this VPS because optional numpy/pandas dependencies are not installed for existing Binance/feature-snapshot/LongBridge tests.
References