From 16534c169dab41c1b61e8fae609b962ad0558804 Mon Sep 17 00:00:00 2001 From: Ke Zhu Date: Fri, 31 Jul 2020 16:42:25 -0400 Subject: [PATCH] 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"), )