Skip to content

Commit 19a8500

Browse files
committed
tiny fix
1 parent 7ada3d9 commit 19a8500

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

openml/_api_calls.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,10 @@ def _read_url_files(url, data=None, file_dictionary=None, file_elements=None):
104104
def _read_url(url, data=None):
105105

106106
data = {} if data is None else data
107-
data['api_key'] = config.apikey
107+
if config.apikey is not None:
108+
data['api_key'] = config.apikey
108109

109-
if len(data) <= 1:
110+
if len(data) == 0 or (len(data) == 1 and 'api_key' in data):
110111
# do a GET
111112
response = requests.get(url, params=data)
112113
else: # an actual post request

0 commit comments

Comments
 (0)