From bae6393c0d46a04f99765585abcee8b6c924f33a Mon Sep 17 00:00:00 2001 From: jrobinAV <88036007+jrobinAV@users.noreply.github.com> Date: Wed, 27 Jul 2022 22:34:16 +0200 Subject: [PATCH 1/2] fix delete scenario --- taipy/core/_repository/_fs_base.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/taipy/core/_repository/_fs_base.py b/taipy/core/_repository/_fs_base.py index 79f25fd11..b9a05815d 100644 --- a/taipy/core/_repository/_fs_base.py +++ b/taipy/core/_repository/_fs_base.py @@ -94,7 +94,7 @@ def dir_path(self): def load(self, model_id: str) -> Entity: try: return self.__to_entity( - self.__get_model_filepath(model_id), retry=Config.global_config.read_entity_retry or 0 + self._get_model_filepath(model_id), retry=Config.global_config.read_entity_retry or 0 ) # type: ignore except FileNotFoundError: raise ModelNotFound(str(self.dir_path), model_id) @@ -119,7 +119,7 @@ def _save(self, entity): self.__create_directory_if_not_exists() model = self._to_model(entity) - self.__get_model_filepath(model.id).write_text( + self._get_model_filepath(model.id).write_text( json.dumps(model.to_dict(), ensure_ascii=False, indent=0, cls=_CustomEncoder, check_circular=False) ) @@ -128,7 +128,7 @@ def _delete_all(self): def _delete(self, model_id: str): try: - self.__get_model_filepath(model_id).unlink() + self._get_model_filepath(model_id).unlink() except FileNotFoundError: raise ModelNotFound(str(self.dir_path), model_id) @@ -181,7 +181,7 @@ def _get_by_configs_and_parent_ids(self, configs_and_parent_ids): def __search(self, attribute: str, value: str) -> Iterator[Entity]: return filter(lambda e: getattr(e, attribute, None) == value, self._load_all()) - def __get_model_filepath(self, model_id) -> pathlib.Path: + def _get_model_filepath(self, model_id) -> pathlib.Path: return self.dir_path / f"{model_id}.json" def __to_entity(self, filepath, by: Optional[str] = None, retry: Optional[int] = 0) -> Entity: From 04948eff8178a24db9a5659ce8f63ac584c8c169 Mon Sep 17 00:00:00 2001 From: jrobinAV <88036007+jrobinAV@users.noreply.github.com> Date: Wed, 27 Jul 2022 22:36:28 +0200 Subject: [PATCH 2/2] change version to 1.1.3 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 8b3efbbc9..b4c21ec3e 100644 --- a/setup.py +++ b/setup.py @@ -56,7 +56,7 @@ test_suite="tests", tests_require=test_requirements, url="https://github.com/avaiga/taipy-core", - version="1.1.2", + version="1.1.3", zip_safe=False, extras_require=extras_require, )