Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare for release and rename parameter to raise_on_failure #323

Merged
merged 6 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion eogrow/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""The main module of the eo-grow package."""

__version__ = "1.7.4"
__version__ = "1.7.5"
2 changes: 1 addition & 1 deletion eogrow/core/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions eogrow/core/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")

Expand Down
4 changes: 3 additions & 1 deletion tests/core/area/test_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
8 changes: 4 additions & 4 deletions tests/core/test_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion tests/test_config_files/other/simple_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
"save_logs": true,
"show_logs": true,
"capture_warnings": true
}
},
"raise_on_failure": false
}