File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -164,13 +164,15 @@ def _resolve_default_cache_dir() -> Path:
164164def get_server_base_url () -> str :
165165 """Return the base URL of the currently configured server.
166166
167- Turns ``"https://www.openml.org/api/v1/xml"`` in ``"https://www.openml.org/"``
167+ Turns ``"https://api.openml.org/api/v1/xml"`` in ``"https://www.openml.org/"``
168+ and ``"https://test.openml.org/api/v1/xml"`` in ``"https://test.openml.org/"``
168169
169170 Returns
170171 -------
171172 str
172173 """
173- return server .split ("/api" )[0 ]
174+ domain , path = server .split ("/api" , maxsplit = 1 )
175+ return domain .replace ("api" , "www" )
174176
175177
176178apikey : str = _defaults ["apikey" ]
@@ -400,10 +402,9 @@ def set_field_in_config_file(field: str, value: Any) -> None:
400402 # There doesn't seem to be a way to avoid writing defaults to file with configparser,
401403 # because it is impossible to distinguish from an explicitly set value that matches
402404 # the default value, to one that was set to its default because it was omitted.
403- value = config .get ("FAKE_SECTION" , f ) # type: ignore
404- if f == field :
405- value = globals ()[f ]
406- fh .write (f"{ f } = { value } \n " )
405+ value = globals ()[f ] if f == field else config .get (f ) # type: ignore
406+ if value is not None :
407+ fh .write (f"{ f } = { value } \n " )
407408
408409
409410def _parse_config (config_file : str | Path ) -> _Config :
You can’t perform that action at this time.
0 commit comments