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

feat(schematic): fds 1931 upgrade schematic version #2651

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
1,377 changes: 721 additions & 656 deletions apps/schematic/api/poetry.lock

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion apps/schematic/api/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ swagger-ui-bundle = "0.0.9"
python-dateutil = "2.8.2"
Flask = "2.1.3"
Flask-Cors = "3.0.10"
schematicpy = "24.2.1"
schematicpy = "24.4.1"
# jsonschema isn't a direct import, but is used by connexion.
# This is to avoid deprecationWarnings
# See https://sagebionetworks.jira.com/browse/FDS-1324
jsonschema = ">=4.0.0 <4.10.0"
# this is to avoid the typing_extensions error
# see https://github.com/ipython/ipython/issues/14380
ipython = "8.18.1"
environs = "^11.0.0"
uwsgi = "^2.0.22"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ def submit_manifest_with_schematic( # pylint: disable=too-many-arguments
data_model_labels=display_label_type,
)
manifest_id: str = metadata_model.submit_metadata_manifest(
path_to_json_ld=schema_path,
manifest_path=manifest_path,
dataset_id=dataset_id,
validate_component=component,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,13 @@ def get_component(
explorer = AttributesExplorer(
path_to_jsonld=schema_path, data_model_labels=display_label_type
)
result: Union[str, BasicError] = explorer.parse_component_attributes( # type: ignore
component=component_label, save_file=False, include_index=include_index
attributes = (
explorer._parse_component_attributes( # pylint:disable=protected-access
component=component_label, save_file=False, include_index=include_index
)
)
assert isinstance(attributes, str)
result: Union[str, BasicError] = attributes
status = 200
return result, status

Expand Down
15 changes: 0 additions & 15 deletions apps/schematic/api/schematic_api/test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,3 @@ def fixture_incorrect_manifest_dataframe() -> Generator:
Yields the path to biospecimen manifest csv
"""
yield INCORRECT_MANIFEST_PATH


@pytest.fixture(scope="session", name="incorrect_manifest_errors")
def fixture_incorrect_manifest_errors() -> Generator:
"""
Yields the expected errors from the incorrect manifest
"""
yield [
[
"2",
"Wrong schema",
"'Tissue Status' is a required property",
"Wrong schema",
]
]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Sample ID,Patient ID,Component
123,1,Biospecimen
Sample ID,Patient ID,Tissue Status,Component
123,1,not_a_valid_status,Biospecimen
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ def test_success_with_one_error(
self,
incorrect_manifest_path: str,
test_schema_url: str,
incorrect_manifest_errors: list,
) -> None:
"""Test for successful result with one validation error"""
with patch.object(
Expand All @@ -143,7 +142,8 @@ def test_success_with_one_error(
)
assert status == 200
assert isinstance(result, ManifestValidationResult)
assert result.errors == incorrect_manifest_errors
assert isinstance(result.errors, list)
assert len(result.errors) > 0
assert result.warnings == []

def test_500(self, correct_manifest_path: str, test_schema_url: str) -> None:
Expand Down Expand Up @@ -193,7 +193,6 @@ def test_success_one_error(
self,
incorrect_manifest_path: str,
test_schema_url: str,
incorrect_manifest_errors: list,
) -> None:
"""Test for successful result with one validation error"""
with patch.object(
Expand All @@ -210,7 +209,8 @@ def test_success_one_error(
)
assert status == 200
assert isinstance(result, ManifestValidationResult)
assert result.errors == incorrect_manifest_errors
assert isinstance(result.errors, list)
assert len(result.errors) > 0
assert result.warnings == []

def test_500(self, correct_manifest_path: str, test_schema_url: str) -> None:
Expand Down
Loading