diff --git a/CHANGELOG.md b/CHANGELOG.md index b67c3628..8ed7e750 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [Version 1.7.4] - 2024-01-10 + +- Parameter `raise_if_failed` renamed to `raise_on_failure` and is now enabled by default. +- Numpy version restricted in anticipation of numpy 2.0 release. + + ## [Version 1.7.4] - 2024-01-03 - Pipelines now have an additional parameter `raise_if_failed` to raise an error if the pipeline failed. diff --git a/eogrow/__init__.py b/eogrow/__init__.py index 24ce8874..8030e953 100644 --- a/eogrow/__init__.py +++ b/eogrow/__init__.py @@ -1,3 +1,3 @@ """The main module of the eo-grow package.""" -__version__ = "1.7.4" +__version__ = "1.7.5" diff --git a/eogrow/core/pipeline.py b/eogrow/core/pipeline.py index 92a64178..78db70f6 100644 --- a/eogrow/core/pipeline.py +++ b/eogrow/core/pipeline.py @@ -253,7 +253,7 @@ def run(self) -> None: pipeline_execution_name=self.current_execution_name, finished=finished, failed=failed ) - if failed and self.config.raise_if_failed: + if failed and self.config.raise_on_failure: raise PipelineExecutionError(f"Pipeline failed some executions. Check {log_folder}.") finally: self.logging_manager.stop_logging(root_logger, handlers) diff --git a/eogrow/core/schemas.py b/eogrow/core/schemas.py index f981160f..6bd10c53 100644 --- a/eogrow/core/schemas.py +++ b/eogrow/core/schemas.py @@ -69,8 +69,8 @@ class PipelineSchema(BaseSchema): raise_on_temporal_mismatch: bool = Field( False, description="Treat `TemporalDimensionWarning` as an exception during EOExecution." ) - raise_if_failed: bool = Field( - False, description="Raise an exception if `run_procedure` returns some executions in `failed`." + raise_on_failure: bool = Field( + True, description="Raise an exception if `run_procedure` returns some executions in `failed`." ) debug: bool = Field(False, description="Run pipeline without the `ray` wrapper to enable debugging.") diff --git a/tests/core/area/test_batch.py b/tests/core/area/test_batch.py index b5f63727..3f8b7bca 100644 --- a/tests/core/area/test_batch.py +++ b/tests/core/area/test_batch.py @@ -24,7 +24,9 @@ @pytest.fixture(name="configured_requests_mock") def request_mock_setup(requests_mock): - requests_mock.post(url="/oauth/token", real_http=True) + requests_mock.post( + url="https://services.sentinel-hub.com/auth/realms/main/protocol/openid-connect/token", real_http=True + ) batch_bounds = { "geometry": { diff --git a/tests/core/test_pipeline.py b/tests/core/test_pipeline.py index e5ba2224..13b7df0d 100644 --- a/tests/core/test_pipeline.py +++ b/tests/core/test_pipeline.py @@ -99,13 +99,13 @@ def test_get_patch_list_filtration_error(test_subset: List[Union[int, str]], sim @pytest.mark.parametrize("fail", [True, False]) -@pytest.mark.parametrize("raise_if_failed", [True, False]) -def test_pipeline_raises_on_failure(fail: bool, raise_if_failed: bool, simple_config_filename: str): +@pytest.mark.parametrize("raise_on_failure", [True, False]) +def test_pipeline_raises_on_failure(fail: bool, raise_on_failure: bool, simple_config_filename: str): config = interpret_config_from_path(simple_config_filename) config.pop("test_param") - pipeline = FailingPipeline.from_raw_config({"fail": fail, "raise_if_failed": raise_if_failed, **config}) + pipeline = FailingPipeline.from_raw_config({**config, "fail": fail, "raise_on_failure": raise_on_failure}) - if fail and raise_if_failed: + if fail and raise_on_failure: with pytest.raises(PipelineExecutionError): pipeline.run() else: diff --git a/tests/test_cli.py b/tests/test_cli.py index 0bd9da09..443d503b 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -26,7 +26,8 @@ def test_pipeline_chain_validation(config_folder): assert subprocess.call(f"eogrow-validate {config_folder}/chain_pipeline.json", shell=True) == 0 -@pytest.mark.order(after=["test_zipmap.py::test_zipmap_pipeline"]) +@pytest.mark.integration() +@pytest.mark.order(after="tests/pipelines/test_zipmap.py::test_zipmap_pipeline") def test_pipeline_chain_execution(config_folder): """Tests a simple execution from command line""" assert subprocess.call(f"eogrow {config_folder}/chain_pipeline.json", shell=True) == 0 diff --git a/tests/test_config_files/other/simple_config.json b/tests/test_config_files/other/simple_config.json index 1542b38f..4ba7bd02 100644 --- a/tests/test_config_files/other/simple_config.json +++ b/tests/test_config_files/other/simple_config.json @@ -8,5 +8,6 @@ "save_logs": true, "show_logs": true, "capture_warnings": true - } + }, + "raise_on_failure": false }