Skip to content

Commit

Permalink
test: update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
renaudjester committed Jul 12, 2024
1 parent 9780a41 commit 3e0e300
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 10 deletions.
4 changes: 2 additions & 2 deletions copernicusmarine/command_line_interface/group_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def cli_group_get() -> None:
"--dataset-id",
"-i",
type=str,
required=True,
default=None,
help="The datasetID.",
)
@force_dataset_version_option
Expand Down Expand Up @@ -245,7 +245,7 @@ def cli_group_get() -> None:
)
@log_exception_and_exit
def get(
dataset_id: str,
dataset_id: Optional[str],
dataset_version: Optional[str],
dataset_part: Optional[str],
username: Optional[str],
Expand Down
2 changes: 1 addition & 1 deletion copernicusmarine/command_line_interface/group_subset.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def cli_group_subset() -> None:
"--dataset-id",
"-i",
type=str,
required=True,
default=None,
help="The datasetID.",
)
@force_dataset_version_option
Expand Down
6 changes: 4 additions & 2 deletions copernicusmarine/core_functions/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@


def get_function(
dataset_id: str,
dataset_id: Optional[str],
force_dataset_version: Optional[str],
force_dataset_part: Optional[str],
username: Optional[str],
Expand Down Expand Up @@ -58,9 +58,11 @@ def get_function(
"Data will come from the staging environment."
)

get_request = GetRequest(dataset_id=dataset_id)
get_request = GetRequest(dataset_id=dataset_id or "")
if request_file:
get_request.from_file(request_file)
if not get_request.dataset_id:
raise ValueError("Please provide a dataset id for a get request.")
request_update_dict = {
"dataset_id": dataset_id,
"force_dataset_version": force_dataset_version,
Expand Down
6 changes: 4 additions & 2 deletions copernicusmarine/core_functions/subset.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@


def subset_function(
dataset_id: str,
dataset_id: Optional[str],
force_dataset_version: Optional[str],
force_dataset_part: Optional[str],
username: Optional[str],
Expand Down Expand Up @@ -85,9 +85,11 @@ def subset_function(
"--netcdf-compression-level option"
)

subset_request = SubsetRequest(dataset_id=dataset_id)
subset_request = SubsetRequest(dataset_id=dataset_id or "")
if request_file:
subset_request.from_file(request_file)
if not subset_request.dataset_id:
raise ValueError("Please provide a dataset id for a subset request.")
if motu_api_request:
motu_api_subset_request = convert_motu_api_request_to_structure(
motu_api_request
Expand Down
2 changes: 1 addition & 1 deletion copernicusmarine/python_interface/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
@deprecated_python_option(**DEPRECATED_OPTIONS.dict_old_names_to_new_names)
@log_exception_and_exit
def get(
dataset_id: str,
dataset_id: Optional[str],
dataset_version: Optional[str] = None,
dataset_part: Optional[str] = None,
username: Optional[str] = None,
Expand Down
1 change: 0 additions & 1 deletion copernicusmarine/python_interface/read_dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def read_dataframe(
subset_method: SubsetMethod = DEFAULT_SUBSET_METHOD,
force_service: Optional[str] = None,
credentials_file: Optional[Union[pathlib.Path, str]] = None,
disable_progress_bar: bool = False,
) -> pandas.DataFrame:
"""
Immediately loads a Pandas DataFrame into memory from a specified dataset.
Expand Down
2 changes: 1 addition & 1 deletion copernicusmarine/python_interface/subset.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
@deprecated_python_option(**DEPRECATED_OPTIONS.dict_old_names_to_new_names)
@log_exception_and_exit
def subset(
dataset_id: str,
dataset_id: Optional[str],
dataset_version: Optional[str] = None,
dataset_part: Optional[str] = None,
username: Optional[str] = None,
Expand Down

0 comments on commit 3e0e300

Please sign in to comment.