Skip to content
Snippets Groups Projects
Commit ceebea0d authored by Fynn Becker's avatar Fynn Becker :crab:
Browse files

Rename path argument to reflect proper usage

Query params should really be passed as params kwarg
instead.
parent 012aa64b
Branches
Tags
No related merge requests found
......@@ -11,9 +11,9 @@ class PostgrestClient:
self.session = requests.Session()
self.session.headers["Authorization"] = "Bearer {}".format(token)
def get(self, path_and_query, singular=False, parse_dt=True, **kwargs):
def get(self, path, singular=False, parse_dt=True, **kwargs):
"""
:param path_and_query: specifies the endpoint and optionally filter queries
:param path: specifies the endpoint
:param singular: if True returns a JSON object rather than a list (406 when multiple results are returned)
:param parse_dt: if True attempts to parse datetime strings to python datetime objects
:return: result(s) as python object or raises HTTPError
......@@ -22,7 +22,7 @@ class PostgrestClient:
self.session.headers["Accept"] = "application/vnd.pgrst.object+json"
else:
self.session.headers["Accept"] = "application/json"
res = self.session.get(urljoin(self.base_uri, path_and_query), **kwargs)
res = self.session.get(urljoin(self.base_uri, path), **kwargs)
try:
res.raise_for_status()
except requests.HTTPError as e:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment