From 6dd3e9a90a947ad5469265821e82018ef44b5e43 Mon Sep 17 00:00:00 2001 From: Mattia Almansi Date: Thu, 14 Nov 2024 14:37:52 +0100 Subject: [PATCH] remove deprecations (#3) --- datapi/catalogue.py | 9 --------- datapi/processing.py | 18 ------------------ tests/integration_test_20_processing.py | 2 +- tests/integration_test_90_features.py | 11 +++-------- 4 files changed, 4 insertions(+), 36 deletions(-) diff --git a/datapi/catalogue.py b/datapi/catalogue.py index 4013337..c096001 100644 --- a/datapi/catalogue.py +++ b/datapi/catalogue.py @@ -15,7 +15,6 @@ from __future__ import annotations import datetime -import warnings from typing import Any, Callable import attrs @@ -87,14 +86,6 @@ def constraints(self) -> list[dict[str, Any]]: "get", url, log_messages=False, **self._request_kwargs )._json_list - def submit(self, **request: Any) -> datapi.Remote: - warnings.warn( - "`.submit` has been deprecated, and in the future will raise an error." - " Please use `.process.submit` from now on.", - DeprecationWarning, - ) - return self.process.submit(**request) - @attrs.define(slots=False) class Catalogue: diff --git a/datapi/processing.py b/datapi/processing.py index 95ab311..c2059cc 100644 --- a/datapi/processing.py +++ b/datapi/processing.py @@ -291,15 +291,6 @@ def collection_ids(self) -> list[str]: """Available collection IDs.""" return [proc["id"] for proc in self._json_dict["processes"]] - @property - def process_ids(self) -> list[str]: - warnings.warn( - "`.process_ids` has been deprecated, and in the future will raise an error." - " Please use `.collection_ids` from now on.", - DeprecationWarning, - ) - return self.collection_ids - @attrs.define class Process(ApiResponse): @@ -610,15 +601,6 @@ def request_uids(self) -> list[str]: """List of request UIDs.""" return [job["jobID"] for job in self._json_dict["jobs"]] - @property - def job_ids(self) -> list[str]: - warnings.warn( - "`.job_ids` has been deprecated, and in the future will raise an error." - " Please use `.request_uids` from now on.", - DeprecationWarning, - ) - return self.request_uids - @attrs.define class Results(ApiResponse): diff --git a/tests/integration_test_20_processing.py b/tests/integration_test_20_processing.py index b64cc33..482759f 100644 --- a/tests/integration_test_20_processing.py +++ b/tests/integration_test_20_processing.py @@ -12,7 +12,7 @@ def test_processig_processes_limit(api_anon_client: ApiClient) -> None: assert len(processes.collection_ids) == 1 next_processes = processes.next assert next_processes is not None - assert len(next_processes.process_ids) == 1 + assert len(next_processes.collection_ids) == 1 def test_processing_processes_sortby(api_anon_client: ApiClient) -> None: diff --git a/tests/integration_test_90_features.py b/tests/integration_test_90_features.py index b081e89..53a2c6c 100644 --- a/tests/integration_test_90_features.py +++ b/tests/integration_test_90_features.py @@ -1,6 +1,5 @@ import datetime import os -import pathlib from pathlib import Path from typing import Any @@ -72,16 +71,12 @@ def test_features_mars_cds_adaptor_format( assert os.path.getsize(result) -def test_features_upload_big_file( - api_anon_client: ApiClient, tmp_path: pathlib.Path -) -> None: +def test_features_upload_big_file(api_anon_client: ApiClient) -> None: # See: https://github.com/fsspec/s3fs/pull/910 - target = str(tmp_path / "test.grib") size = 1_048_576_000 + 1 - api_anon_client.retrieve( + results = api_anon_client.submit_and_wait_on_results( "test-adaptor-dummy", size=size, _timestamp=datetime.datetime.now().isoformat(), - target=target, ) - assert os.path.getsize(target) == size + assert results.content_length == size