Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
sbilge committed Nov 27, 2024
1 parent 40fa62e commit 839feac
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/metldata/builtin_transformations/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def model_to_dict(
return json.loads(dumps_schemapack(deepcopy(model), yaml_format=False))


def data_to_dict(data:DataPack)-> dict[str, Any]:
def data_to_dict(data: DataPack) -> dict[str, Any]:
"""Converts the provided DataPack data to a JSON-serializable dictionary.
Returns:
Expand All @@ -47,7 +47,7 @@ def data_to_dict(data:DataPack)-> dict[str, Any]:
return json.loads(dumps_datapack(deepcopy(data), yaml_format=False))


def _thaw_content(frozen_dict: Mapping ) -> dict:
def _thaw_content(frozen_dict: Mapping) -> dict:
"""Recursively converts a nested FrozenDict and frozenset to mutable types.
This will be removed after we implement a FrozenDict validation to Schemapack lib.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ def count_content(
modified_data = data_to_dict(data)

for class_name, instructions in instructions_by_class.items():
transform_class(class_name=class_name, data=modified_data, instructions=instructions)
transform_class(
class_name=class_name, data=modified_data, instructions=instructions
)
return DataPack.model_validate(modified_data)


Expand Down Expand Up @@ -95,7 +97,7 @@ def transform_resource(
target_content = target_resource.get("content")
if not target_content:
raise EvitableTransformationError()

relation_target_ids = target_resource.get("relations", {}).get(relation_name)
if not relation_target_ids:
raise EvitableTransformationError()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ def assert_classes_and_properties_exist(
)

for property in properties:
if property not in model.classes[class_name].content.get(
"properties", {}
):
if property not in model.classes[class_name].content.get("properties", {}):
raise ModelAssumptionError(
f"Property {property} does not exist in class {class_name}."
)

0 comments on commit 839feac

Please sign in to comment.