Skip to content

Commit 16534c1

Browse files
author
Ke Zhu
committed
Format nextUri responded from server
1 parent b87744e commit 16534c1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

prestodb/client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import prestodb.logging
4141
import prestodb.redirect
4242
import requests
43+
from six.moves.urllib.parse import urlparse
4344
from prestodb import constants, exceptions
4445
from prestodb.transaction import NO_TRANSACTION
4546

@@ -337,7 +338,8 @@ def statement_url(self):
337338
@property
338339
def next_uri(self):
339340
# type: () -> Text
340-
return self._next_uri
341+
next_uri_path = urlparse(self._next_uri).path
342+
return self.get_url(next_uri_path)
341343

342344
def post(self, sql):
343345
data = sql.encode("utf-8")
@@ -431,7 +433,7 @@ def process(self, http_response):
431433
stats=response["stats"],
432434
warnings=response.get("warnings", []),
433435
info_uri=response["infoUri"],
434-
next_uri=self._next_uri,
436+
next_uri=self.next_uri,
435437
rows=response.get("data", []),
436438
columns=response.get("columns"),
437439
)

0 commit comments

Comments
 (0)