Skip to content

Commit e9cfde6

Browse files
authored
Send user params as formdata (#38)
* Send user parameters as form-data when calling get_result()
1 parent c4e555c commit e9cfde6

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

ExtractTable/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def view_transactions(self) -> list:
8282
resp = self._make_request("GET", HOST.TRANSACTIONS)
8383
return resp
8484

85-
def get_result(self, job_id: str, wait_time: int = 10, max_wait_time: int = 300) -> dict:
85+
def get_result(self, job_id: str, wait_time: int = 10, max_wait_time: int = 300, **kwargs) -> dict:
8686
"""
8787
Retrieve the tabular data of a triggered job based on the JobId
8888
:param job_id: JobId received from an already triggered process
@@ -91,13 +91,14 @@ def get_result(self, job_id: str, wait_time: int = 10, max_wait_time: int = 300)
9191
:return: Tabular JSON when processed successful else helpful user info
9292
"""
9393
params = {'JobId': job_id}
94-
resp = self._make_request('get', HOST.RESULT, params=params)
94+
form_data = dict(kwargs)
95+
resp = self._make_request('get', HOST.RESULT, params=params, data=form_data)
9596
# Loop to retrieve the output until max_wait_time is reached
9697
max_wait_time = int(max_wait_time)
9798
while self._WAIT_UNTIL_OUTPUT and resp["JobStatus"] == JobStatus.PROCESSING and max_wait_time > 0:
9899
time.sleep(max(10, int(wait_time)))
99100
max_wait_time -= wait_time
100-
resp = self._make_request('get', HOST.RESULT, params=params)
101+
resp = self._make_request('get', HOST.RESULT, params=params, data=form_data)
101102

102103
return resp
103104

ExtractTable/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION = (2, 2, 0)
1+
VERSION = (2, 3, 0)
22
PRERELEASE = None # "alpha", "beta" or "rc"
33
REVISION = None
44

setup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@ def setup_package():
3131
# Trove classifiers
3232
# Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers
3333
'License :: OSI Approved :: Apache Software License',
34-
'Programming Language :: Python :: 3.5',
3534
'Programming Language :: Python :: 3.6',
36-
'Programming Language :: Python :: 3.7'
35+
'Programming Language :: Python :: 3.7',
36+
'Programming Language :: Python :: 3.8',
37+
'Programming Language :: Python :: 3.9',
38+
'Programming Language :: Python :: 3.10'
3739
])
3840

3941
try:

0 commit comments

Comments
 (0)