Skip to content

Commit

Permalink
Merge pull request #574 from sennetconsortium/libpitt/568-lab_id
Browse files Browse the repository at this point in the history
Update method exclude_properties_from_response to handle nested lists…
  • Loading branch information
maxsibilla authored Jan 13, 2025
2 parents 3ce746d + 784560e commit ade0947
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/schema/provenance_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,17 @@ ENTITIES:
before_entity_create_validator: validate_application_header_before_entity_create
excluded_properties_from_public_response:
- lab_dataset_id
- direct_ancestors:
- lab_tissue_sample_id
- source:
- lab_source_id
- origin_samples:
- lab_tissue_sample_id
- sources:
- lab_source_id
- metadata:
- lab_id
- slide_id
- ingest_metadata:
- metadata:
- lab_id
Expand Down
6 changes: 5 additions & 1 deletion src/schema/schema_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,11 @@ def delete_nested_field(data, nested_path):
if isinstance(value, list):
for nested_field in value:
if isinstance(nested_field, dict):
delete_nested_field(data[key], nested_field)
if isinstance(data[key], list):
for item in data[key]:
delete_nested_field(item, nested_field)
else:
delete_nested_field(data[key], nested_field)

elif isinstance(data[key], list):
for item in data[key]:
Expand Down

0 comments on commit ade0947

Please sign in to comment.