Skip to content

Commit

Permalink
Format nextUri responded from server
Browse files Browse the repository at this point in the history
  • Loading branch information
Ke Zhu committed Aug 1, 2020
1 parent b87744e commit 16534c1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions prestodb/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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"),
)
Expand Down

0 comments on commit 16534c1

Please sign in to comment.