Skip to content

Commit

Permalink
param check
Browse files Browse the repository at this point in the history
  • Loading branch information
tsmonteiro committed Feb 8, 2024
1 parent 03ec308 commit f692a95
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions tercen/client/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,24 @@ def __init__(self):
def selectStream(self, tableId, cnames, offset, limit):
response = None
try:
if offset == 0 and limit == -1:
uri = URI.create("api/v1/schema" + "/" + "selectStream")
else:
uri = URI.create("api/v1/schema" + "/" + "select")
params = {}
params["tableId"] = tableId
params["cnames"] = cnames
params["offset"] = int(offset)
params["limit"] = int(limit)

if (offset is None or offset == 0) and\
(limit is None or limit == -1):
uri = URI.create("api/v1/schema" + "/" + "selectStream")
params["offset"] = offset
params["limit"] = limit
else:
uri = URI.create("api/v1/schema" + "/" + "select")
params["offset"] = int(offset)
if limit is None:
params["limit"] = limit
else:
params["limit"] = int(limit)


response = self.getHttpClient().post(
self.getServiceUri(uri).toString(), None, encodeTSON(params))
if response.code() != 200:
Expand Down

0 comments on commit f692a95

Please sign in to comment.