Skip to content

Commit a704bb0

Browse files
committed
chore: fixed pre commit errors
Signed-off-by: rohansen856 <rohansen856@gmail.com>
1 parent 33858a7 commit a704bb0

2 files changed

Lines changed: 7 additions & 26 deletions

File tree

openml/_config.py

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,6 @@ class OpenMLConfig:
9999
)
100100
api_version: APIVersion = APIVersion.V1
101101
fallback_api_version: APIVersion | None = None
102-
apikey: str | None = ""
103-
server: str = "https://www.openml.org/api/v1/xml"
104102
cachedir: Path = field(default_factory=_resolve_default_cache_dir)
105103
avoid_duplicate_runs: bool = False
106104
retry_policy: Literal["human", "robot"] = "human"
@@ -425,8 +423,6 @@ def _setup(self, config: dict[str, Any] | None = None) -> None:
425423
servers=config["servers"],
426424
api_version=config["api_version"],
427425
fallback_api_version=config["fallback_api_version"],
428-
apikey=config["apikey"],
429-
server=config["server"],
430426
show_progress=config["show_progress"],
431427
avoid_duplicate_runs=config["avoid_duplicate_runs"],
432428
retry_policy=config["retry_policy"],
@@ -534,11 +530,9 @@ def start_using_configuration_for_example(self) -> None:
534530
type(self)._start_last_called = True
535531

536532
# Test server key for examples
537-
self._manager._config = replace(
538-
self._manager._config,
539-
server=self._test_server,
540-
apikey=self._test_apikey,
541-
)
533+
self._manager._config = replace(self._manager._config)
534+
self._manager._config.server = self._test_server
535+
self._manager._config.apikey = self._test_apikey
542536
warnings.warn(
543537
f"Switching to the test server {self._test_server} to not upload results to "
544538
"the live server. Using the test server may result in reduced performance of the "
@@ -556,12 +550,9 @@ def stop_using_configuration_for_example(self) -> None:
556550
"`start_use_example_configuration` must be called first.",
557551
)
558552

559-
self._manager._config = replace(
560-
self._manager._config,
561-
server=cast("str", self._last_used_server),
562-
apikey=cast("str", self._last_used_key),
563-
)
564-
type(self)._start_last_called = False
553+
self._manager._config = replace(self._manager._config)
554+
self._manager._config.server = cast("str", self._last_used_server)
555+
self._manager._config.apikey = cast("str", self._last_used_key)
565556

566557

567558
__config = OpenMLConfigManager()

openml/cli.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,7 @@ def check_server(server: str) -> str:
112112

113113
def replace_shorthand(server: str) -> str:
114114
if server == "test":
115-
<<<<<<< studies-migration
116115
return cast("str", openml.config.get_servers("test")[APIVersion.V1]["server"])
117-
=======
118-
return f"{openml.config.TEST_SERVER_URL}/api/v1/xml"
119-
>>>>>>> main
120116
if server == "production_server":
121117
return cast("str", openml.config.get_servers("production")[APIVersion.V1]["server"])
122118
return server
@@ -355,13 +351,7 @@ def main() -> None:
355351
)
356352

357353
configurable_fields = [
358-
<<<<<<< studies-migration
359-
f.name
360-
for f in fields(openml._config.OpenMLConfig)
361-
if f.name not in ["connection_n_retries"]
362-
=======
363-
f.name for f in fields(openml._config.OpenMLConfig) if f.name not in ["max_retries"]
364-
>>>>>>> main
354+
f.name for f in fields(openml._config.OpenMLConfig) if f.name not in ["servers"]
365355
]
366356

367357
parser_configure.add_argument(

0 commit comments

Comments
 (0)