We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1e876b4 commit 576987bCopy full SHA for 576987b
postgrest/base_request_builder.py
@@ -207,11 +207,11 @@ def _get_count_from_http_request_response(
207
def from_http_request_response(
208
cls: Type[Self], request_response: RequestResponse
209
) -> Self:
210
+ count = cls._get_count_from_http_request_response(request_response)
211
try:
212
data = request_response.json()
213
except JSONDecodeError:
- return cls(data=[], count=0)
214
- count = cls._get_count_from_http_request_response(request_response)
+ data = request_response.text if len(request_response.text) > 0 else []
215
# the type-ignore here is as pydantic needs us to pass the type parameter
216
# here explicitly, but pylance already knows that cls is correctly parametrized
217
return cls[_ReturnT](data=data, count=count) # type: ignore
0 commit comments