Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format nextUri responds from server #101

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
shawnzhu marked this conversation as resolved.
Show resolved Hide resolved
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