Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,16 @@ build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["robosystems_client"]

[tool.basedpyright]
include = []
exclude = ["**/*"]
extraPaths = ["."]
pythonVersion = "3.12"
venvPath = "."
venv = ".venv"
typeCheckingMode = "standard"
reportAttributeAccessIssue = "none"
reportArgumentType = "none"
reportGeneralTypeIssues = "none"
reportOptionalMemberAccess = "none"
reportReturnType = "none"
5 changes: 0 additions & 5 deletions robosystems_client/api/query/execute_cypher_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
) -> Optional[Union[Any, HTTPValidationError]]:
if response.status_code == 200:
# Check if this is NDJSON - if so, skip parsing (will be handled by client)
content_type = response.headers.get("content-type", "")
stream_format = response.headers.get("x-stream-format", "")
if "application/x-ndjson" in content_type or stream_format == "ndjson":
return None # Skip parsing, client will handle NDJSON
response_200 = response.json()
return response_200
Comment on lines 67 to 71

Choose a reason for hiding this comment

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

P1 Badge NDJSON responses now parsed incorrectly

The _parse_response helper no longer checks for NDJSON (content-type: application/x-ndjson or x-stream-format: ndjson) before calling response.json(). For streaming Cypher queries the server returns an NDJSON stream, which previously skipped parsing so the caller could iterate the stream. With the guard removed, response.json() will attempt to read and decode the entire stream as a single JSON document and raise JSONDecodeError (or buffer the whole response) whenever NDJSON is returned. This breaks the streaming query path and can regress both functionality and memory usage.

Useful? React with 👍 / 👎.


Expand Down
Loading