Skip to content

Commit 7ada3d9

Browse files
committed
for bypassing api checking
1 parent b30192a commit 7ada3d9

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

openml/_api_calls.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,13 @@ def _read_url(url, data=None):
106106
data = {} if data is None else data
107107
data['api_key'] = config.apikey
108108

109-
# Using requests.post sets header 'Accept-encoding' automatically to
110-
# 'gzip,deflate'
111-
response = requests.post(url, data=data)
109+
if len(data) <= 1:
110+
# do a GET
111+
response = requests.get(url, params=data)
112+
else: # an actual post request
113+
# Using requests.post sets header 'Accept-encoding' automatically to
114+
# 'gzip,deflate'
115+
response = requests.post(url, data=data)
112116

113117
if response.status_code != 200:
114118
raise _parse_server_exception(response)

openml/study/functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def get_study(study_id):
1818
Note that some of the (data, tasks, flows, setups) fields can be empty
1919
(depending on information on the server)
2020
'''
21-
xml_string = _perform_api_call("study/%d" %(study_id))
21+
xml_string = _perform_api_call("study/%s" %str(study_id))
2222
result_dict = xmltodict.parse(xml_string)['oml:study']
2323
id = int(result_dict['oml:id'])
2424
name = result_dict['oml:name']

0 commit comments

Comments
 (0)