@@ -232,7 +232,7 @@ def _list_datasets(**kwargs):
232232
233233def __list_datasets (api_call ):
234234
235- xml_string = openml ._api_calls ._perform_api_call (api_call )
235+ xml_string = openml ._api_calls ._perform_api_call (api_call , 'get' )
236236 datasets_dict = xmltodict .parse (xml_string , force_list = ('oml:dataset' ,))
237237
238238 # Minimalistic check if the XML is useful
@@ -621,6 +621,7 @@ def status_update(data_id, status):
621621 'Legal values: %s' % legal_status )
622622 data = {'data_id' : data_id , 'status' : status }
623623 result_xml = openml ._api_calls ._perform_api_call ("data/status/update" ,
624+ 'post' ,
624625 data = data )
625626 result = xmltodict .parse (result_xml )
626627 server_data_id = result ['oml:data_status_update' ]['oml:id' ]
@@ -659,7 +660,8 @@ def _get_dataset_description(did_cache_dir, dataset_id):
659660 try :
660661 return _get_cached_dataset_description (dataset_id )
661662 except OpenMLCacheException :
662- dataset_xml = openml ._api_calls ._perform_api_call ("data/%d" % dataset_id )
663+ url_suffix = "data/%d" % dataset_id
664+ dataset_xml = openml ._api_calls ._perform_api_call (url_suffix , 'get' )
663665 with io .open (description_file , "w" , encoding = 'utf8' ) as fh :
664666 fh .write (dataset_xml )
665667
@@ -704,7 +706,7 @@ def _get_dataset_arff(did_cache_dir, description):
704706 pass
705707
706708 url = description ['oml:url' ]
707- arff_string = openml ._api_calls ._read_url (url )
709+ arff_string = openml ._api_calls ._read_url (url , request_method = 'get' )
708710 md5 = hashlib .md5 ()
709711 md5 .update (arff_string .encode ('utf-8' ))
710712 md5_checksum = md5 .hexdigest ()
@@ -751,7 +753,8 @@ def _get_dataset_features(did_cache_dir, dataset_id):
751753 with io .open (features_file , encoding = 'utf8' ) as fh :
752754 features_xml = fh .read ()
753755 except (OSError , IOError ):
754- features_xml = openml ._api_calls ._perform_api_call ("data/features/%d" % dataset_id )
756+ url_suffix = "data/features/%d" % dataset_id
757+ features_xml = openml ._api_calls ._perform_api_call (url_suffix , 'get' )
755758
756759 with io .open (features_file , "w" , encoding = 'utf8' ) as fh :
757760 fh .write (features_xml )
@@ -787,7 +790,8 @@ def _get_dataset_qualities(did_cache_dir, dataset_id):
787790 with io .open (qualities_file , encoding = 'utf8' ) as fh :
788791 qualities_xml = fh .read ()
789792 except (OSError , IOError ):
790- qualities_xml = openml ._api_calls ._perform_api_call ("data/qualities/%d" % dataset_id )
793+ url_suffix = "data/qualities/%d" % dataset_id
794+ qualities_xml = openml ._api_calls ._perform_api_call (url_suffix , 'get' )
791795
792796 with io .open (qualities_file , "w" , encoding = 'utf8' ) as fh :
793797 fh .write (qualities_xml )
@@ -859,11 +863,13 @@ def _get_online_dataset_arff(dataset_id):
859863 str
860864 A string representation of an ARFF file.
861865 """
862- dataset_xml = openml ._api_calls ._perform_api_call ("data/%d" % dataset_id )
866+ dataset_xml = openml ._api_calls ._perform_api_call ("data/%d" % dataset_id ,
867+ 'get' )
863868 # build a dict from the xml.
864869 # use the url from the dataset description and return the ARFF string
865870 return openml ._api_calls ._read_url (
866- xmltodict .parse (dataset_xml )['oml:data_set_description' ]['oml:url' ]
871+ xmltodict .parse (dataset_xml )['oml:data_set_description' ]['oml:url' ],
872+ request_method = 'get'
867873 )
868874
869875
@@ -881,7 +887,8 @@ def _get_online_dataset_format(dataset_id):
881887 str
882888 Dataset format.
883889 """
884- dataset_xml = openml ._api_calls ._perform_api_call ("data/%d" % dataset_id )
890+ dataset_xml = openml ._api_calls ._perform_api_call ("data/%d" % dataset_id ,
891+ 'get' )
885892 # build a dict from the xml and get the format from the dataset description
886893 return xmltodict \
887894 .parse (dataset_xml )['oml:data_set_description' ]['oml:format' ]\
0 commit comments