From 0dc4427670c96ef7edc1953ec78b4f18fdcf17fe Mon Sep 17 00:00:00 2001 From: avibhstarburst Date: Tue, 30 Jan 2024 14:46:59 +0200 Subject: [PATCH] Add support for 'None' on response data --- trino/client.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/trino/client.py b/trino/client.py index c7f26a80..e145f3b9 100644 --- a/trino/client.py +++ b/trino/client.py @@ -633,6 +633,9 @@ def process(self, http_response) -> TrinoStatus: self._next_uri = response.get("nextUri") + data = response.get("data", []) + if not data: + data = [] return TrinoStatus( id=response["id"], stats=response["stats"], @@ -641,7 +644,7 @@ def process(self, http_response) -> TrinoStatus: next_uri=self._next_uri, update_type=response.get("updateType"), update_count=response.get("updateCount"), - rows=response.get("data", []), + rows=data, columns=response.get("columns"), )