Skip to content

Commit

Permalink
Merge pull request #65 from pepkit/issue20_output_schema
Browse files Browse the repository at this point in the history
Align Pipestat output schema with looper output schema
  • Loading branch information
donaldcampbelljr authored Aug 7, 2023
2 parents 61b7160 + bd2baa2 commit 9746333
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
4 changes: 4 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 4 additions & 2 deletions pipestat/parsed_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
7 changes: 0 additions & 7 deletions tests/test_parsed_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,6 @@ def test_parsed_schema__has_correct_data_and_print(
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):
Expand Down

0 comments on commit 9746333

Please sign in to comment.