Skip to content

Commit

Permalink
update depricated pydantic functions
Browse files Browse the repository at this point in the history
  • Loading branch information
duprijil committed Oct 4, 2023
1 parent 4870847 commit a1eb832
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ted_sws/event_manager/adapters/event_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def _prepare_message(cls, event_message: EventMessage):
:return: None
"""
event_message.caller_name = cls._caller_name(event_message)
return str(event_message.dict())
return str(event_message.model_dump())

def log(self, severity_level: SeverityLevelType, event_message: EventMessage,
settings: EventMessageLogSettings = EventMessageLogSettings()):
Expand Down
2 changes: 1 addition & 1 deletion ted_sws/event_manager/adapters/event_logging_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def prepare_record(cls, event_message: EventMessage) -> dict:
:return: The event message dict
"""

event_message_dict = event_message.dict()
event_message_dict = event_message.model_dump()
for event_date_field_name in LOGGING_DATE_FIELD_NAMES:
inject_date_string_fields(data=event_message_dict, date_field_name=event_date_field_name,
date_string_fields_suffix_map=LOGGING_DATE_STRING_FIELDS_SUFFIX_MAP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,6 @@ def get_git_head_hash(git_repository_path: pathlib.Path) -> str:
git_last_commit_hash = get_git_head_hash(
git_repository_path=temp_dir_path / self.github_repository_name)
downloaded_tmp_mapping_suite_path = temp_dir_path / self.github_repository_name / MAPPINGS_DIR_NAME
downloaded_tmp_mapping_suite_path.mkdir(exist_ok=True, parents=True)
shutil.copytree(downloaded_tmp_mapping_suite_path, output_mapping_suite_package_path, dirs_exist_ok=True)
return git_last_commit_hash
Original file line number Diff line number Diff line change
Expand Up @@ -202,17 +202,17 @@ def mapping_suite_diff_conceptual_mappings(mappings: List[ConceptualMapping]) ->
"conceptual_mapping": MS_TRANSFORM_FOLDER_NAME + "/" + MS_CONCEPTUAL_MAPPING_FILE_NAME
},
metadata=[
mappings[0].metadata.dict(),
mappings[1].metadata.dict()
mappings[0].metadata.model_dump(),
mappings[1].metadata.model_dump()
]
)
mapping1: dict = mappings[0].dict()
mapping2: dict = mappings[1].dict()
mapping1: dict = mappings[0].model_dump()
mapping2: dict = mappings[1].model_dump()

diff.data = transform_conceptual_mappings_diff_data(ConceptualMappingDiffData(
original=DeepDiff(mapping1, mapping2, ignore_order=False)
), mapping1=mappings[0], mapping2=mappings[1])
return diff.dict()
return diff.model_dump()


def mapping_suite_diff_files_conceptual_mappings(filepaths: List[Path]) -> dict:
Expand Down

0 comments on commit a1eb832

Please sign in to comment.