From 16534c169dab41c1b61e8fae609b962ad0558804 Mon Sep 17 00:00:00 2001 From: Ke Zhu Date: Fri, 31 Jul 2020 16:42:25 -0400 Subject: [PATCH 1/2] Format nextUri responded from server --- prestodb/client.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/prestodb/client.py b/prestodb/client.py index 717a6da..b19ce66 100644 --- a/prestodb/client.py +++ b/prestodb/client.py @@ -40,6 +40,7 @@ import prestodb.logging import prestodb.redirect import requests +from six.moves.urllib.parse import urlparse from prestodb import constants, exceptions from prestodb.transaction import NO_TRANSACTION @@ -337,7 +338,8 @@ def statement_url(self): @property def next_uri(self): # type: () -> Text - return self._next_uri + next_uri_path = urlparse(self._next_uri).path + return self.get_url(next_uri_path) def post(self, sql): data = sql.encode("utf-8") @@ -431,7 +433,7 @@ def process(self, http_response): stats=response["stats"], warnings=response.get("warnings", []), info_uri=response["infoUri"], - next_uri=self._next_uri, + next_uri=self.next_uri, rows=response.get("data", []), columns=response.get("columns"), ) From 39e8b0dcf364c78c77e545847e891783ddba7ade Mon Sep 17 00:00:00 2001 From: Shawn Zhu Date: Wed, 26 Jan 2022 21:34:36 -0500 Subject: [PATCH 2/2] Address review comments --- prestodb/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prestodb/client.py b/prestodb/client.py index b19ce66..d5ee7fd 100644 --- a/prestodb/client.py +++ b/prestodb/client.py @@ -40,7 +40,7 @@ import prestodb.logging import prestodb.redirect import requests -from six.moves.urllib.parse import urlparse +from urllib.parse import urlparse from prestodb import constants, exceptions from prestodb.transaction import NO_TRANSACTION