From e6e1d7d16f3e85f3aba397dd57c5c3f6486dcae5 Mon Sep 17 00:00:00 2001 From: Donald Campbell <125581724+donaldcampbelljr@users.noreply.github.com> Date: Fri, 4 Aug 2023 12:20:37 -0400 Subject: [PATCH 1/2] Assign top-level arguments from output schema to be project level. Remove error and pytest associated with error. --- pipestat/parsed_schema.py | 6 ++++-- tests/test_parsed_schema.py | 7 ------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/pipestat/parsed_schema.py b/pipestat/parsed_schema.py index 2b0451a5..7b31ccf0 100644 --- a/pipestat/parsed_schema.py +++ b/pipestat/parsed_schema.py @@ -91,9 +91,11 @@ def __init__(self, data: Union[Dict[str, Any], Path, str]) -> None: self._status_data = _safe_pop_one_mapping(key="status", data=data, info_name="status") if data: - raise SchemaError( - f"Extra top-level key(s) in given schema data: {', '.join(data.keys())}" + _LOGGER.info( + "Top-Level arguments found in output schema. They will be assigned to project-level." ) + extra_project_data = _recursively_replace_custom_types(data) + self._project_level_data.update(extra_project_data) # Check that no reserved keywords were used as data items. resv_kwds = {"id", SAMPLE_NAME} diff --git a/tests/test_parsed_schema.py b/tests/test_parsed_schema.py index eee1c18b..1e95ba5c 100644 --- a/tests/test_parsed_schema.py +++ b/tests/test_parsed_schema.py @@ -197,13 +197,6 @@ def test_parsed_schema__has_correct_data(prepare_schema_from_file, filename, att f"Could not find valid pipeline identifier (key '{SCHEMA_PIPELINE_NAME_KEY}') in given schema data", ) for data in SCHEMA_DATA_TUPLES_WITHOUT_PIPELINE_NAME - ] - + [ - ( - dict(data + [(SCHEMA_PIPELINE_NAME_KEY, "test_pipe"), ("extra_key", "placeholder")]), - "Extra top-level key(s) in given schema data: extra_key", - ) - for data in SCHEMA_DATA_TUPLES_WITHOUT_PIPELINE_NAME ], ) def test_insufficient_schema__raises_expected_error_and_message(schema_data, expected_message): From bd2baa21b3d9e7053e69bcc12962b3dd15006d40 Mon Sep 17 00:00:00 2001 From: Donald Campbell <125581724+donaldcampbelljr@users.noreply.github.com> Date: Fri, 4 Aug 2023 12:38:24 -0400 Subject: [PATCH 2/2] Change codecov patch target --- codecov.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/codecov.yml b/codecov.yml index 35424d84..5f02882d 100644 --- a/codecov.yml +++ b/codecov.yml @@ -5,6 +5,10 @@ coverage: target: 80% # the required coverage value threshold: 1% # the leniency in hitting the target informational: true + patch: + default: + target: 80% + informational: true ignore: - "*/argparser.py" - "*/cli.py"