Skip to content

Commit

Permalink
remove deprecations (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
malmans2 authored Nov 14, 2024
1 parent e56caca commit 6dd3e9a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 36 deletions.
9 changes: 0 additions & 9 deletions datapi/catalogue.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from __future__ import annotations

import datetime
import warnings
from typing import Any, Callable

import attrs
Expand Down Expand Up @@ -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:
Expand Down
18 changes: 0 additions & 18 deletions datapi/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_test_20_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
11 changes: 3 additions & 8 deletions tests/integration_test_90_features.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import datetime
import os
import pathlib
from pathlib import Path
from typing import Any

Expand Down Expand Up @@ -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

0 comments on commit 6dd3e9a

Please sign in to comment.