|
15 | 15 | import requests |
16 | 16 |
|
17 | 17 | import openml |
18 | | -from openml._api import API_REGISTRY, HTTPCache, HTTPClient, MinIOClient, ResourceAPI |
19 | | -from openml.enums import APIVersion, ResourceType |
20 | 18 | from openml.exceptions import OpenMLServerException |
21 | 19 | from openml.tasks import TaskType |
22 | 20 |
|
@@ -55,11 +53,6 @@ class TestBase(unittest.TestCase): |
55 | 53 | logger = logging.getLogger("unit_tests_published_entities") |
56 | 54 | logger.setLevel(logging.DEBUG) |
57 | 55 |
|
58 | | - # migration-specific attributes |
59 | | - cache: HTTPCache |
60 | | - http_clients: dict[APIVersion, HTTPClient] |
61 | | - minio_client: MinIOClient |
62 | | - |
63 | 56 | def setUp(self, n_levels: int = 1, tmpdir_suffix: str = "") -> None: |
64 | 57 | """Setup variables and temporary directories. |
65 | 58 |
|
@@ -111,13 +104,6 @@ def setUp(self, n_levels: int = 1, tmpdir_suffix: str = "") -> None: |
111 | 104 | self.connection_n_retries = openml.config.connection_n_retries |
112 | 105 | openml.config.set_retry_policy("robot", n_retries=20) |
113 | 106 |
|
114 | | - self.cache = HTTPCache() |
115 | | - self.http_clients = { |
116 | | - APIVersion.V1: HTTPClient(api_version=APIVersion.V1), |
117 | | - APIVersion.V2: HTTPClient(api_version=APIVersion.V2), |
118 | | - } |
119 | | - self.minio_client = MinIOClient() |
120 | | - |
121 | 107 | def use_production_server(self) -> None: |
122 | 108 | """ |
123 | 109 | Use the production server for the OpenML API calls. |
@@ -284,11 +270,6 @@ def _check_fold_timing_evaluations( # noqa: PLR0913 |
284 | 270 | assert evaluation >= min_val |
285 | 271 | assert evaluation <= max_val |
286 | 272 |
|
287 | | - def _create_resource(self, api_version: APIVersion, resource_type: ResourceType) -> ResourceAPI: |
288 | | - http_client = self.http_clients[api_version] |
289 | | - resource_cls = API_REGISTRY[api_version][resource_type] |
290 | | - return resource_cls(http=http_client, minio=self.minio_client) |
291 | | - |
292 | 273 |
|
293 | 274 | def check_task_existence( |
294 | 275 | task_type: TaskType, |
|
0 commit comments