Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Christoph Zwerschke <c.zwerschke@dkfz-heidelberg.de>
  • Loading branch information
lkuchenb and Cito committed May 14, 2024
1 parent cf2f255 commit d042e66
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,5 @@ def delete_properties(
)

model_dict = model.model_dump()
model_dict.update({"classes": {**model.classes, **updated_class_defs}})
model_dict["classes"].update(updated_class_defs)
return SchemaPack.model_validate(model_dict)
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@
as defined in the inferred relation
"""

from collections.abc import Set

from schemapack.spec.custom_types import ResourceId
from schemapack.spec.datapack import DataPack, Resource

Expand Down Expand Up @@ -96,15 +94,12 @@ def resolve_active_path_element(
if not source_resource:
raise EvitableTransformationError()

target_resource_ids = source_resource.relations.get(path_element.property, set())
target_resource_ids = source_resource.relations.get(path_element.property)
if target_resource_ids is None:
target_resource_ids = set()

return (
set(target_resource_ids)
if isinstance(target_resource_ids, Set)
else set([target_resource_ids])
)
elif isinstance(target_resource_ids, str):
target_resource_ids = {target_resource_ids}
return target_resource_ids


def resolve_passive_path_element(
Expand Down

0 comments on commit d042e66

Please sign in to comment.