From 86ba87a70e5b1dd654a75e2cd31d4ded6d7ba4d5 Mon Sep 17 00:00:00 2001 From: "Etienne Scholly, Ph.D" <145967193+drscholly@users.noreply.github.com> Date: Tue, 13 Feb 2024 18:37:22 +0100 Subject: [PATCH] Noop: remove useless logging commands (#26) They are useless for a normal usage of the tool and flood the terminal when copying a lot of objects. --- toolbox/api/datagalaxy_api_glossary.py | 1 - toolbox/api/datagalaxy_api_usages.py | 1 - toolbox/commands/copy_glossary.py | 2 -- toolbox/commands/copy_usages.py | 2 -- 4 files changed, 6 deletions(-) diff --git a/toolbox/api/datagalaxy_api_glossary.py b/toolbox/api/datagalaxy_api_glossary.py index 6f85b8a..7cd64ff 100644 --- a/toolbox/api/datagalaxy_api_glossary.py +++ b/toolbox/api/datagalaxy_api_glossary.py @@ -43,7 +43,6 @@ def list_properties(self, workspace_name: str) -> list: def bulk_upsert_property_tree(self, workspace_name: str, properties: list) -> DataGalaxyBulkResult: # Existing entities are updated and non-existing ones are created. properties_ok_to_bulk = to_bulk_tree(properties) - logging.info(f'properties_ok_to_bulk: {properties_ok_to_bulk}') if not self.workspace["isVersioningEnabled"]: version_id = self.workspace['defaultVersionId'] diff --git a/toolbox/api/datagalaxy_api_usages.py b/toolbox/api/datagalaxy_api_usages.py index 1afc5a8..2c0aadd 100644 --- a/toolbox/api/datagalaxy_api_usages.py +++ b/toolbox/api/datagalaxy_api_usages.py @@ -51,7 +51,6 @@ def list_usages(self, workspace_name: str) -> list: def bulk_upsert_usages_tree(self, workspace_name: str, usages: list) -> DataGalaxyBulkResult: # Existing entities are updated and non-existing ones are created. usages_ok_to_bulk = to_bulk_tree(usages) - logging.info(f'usages_ok_to_bulk: {usages_ok_to_bulk}') # If a parent usage has a technology, it is necessary to delete the "technologyCode" property in every children # Otherwise the API returns an error. Only the parent can hold the "technologyCode" property diff --git a/toolbox/commands/copy_glossary.py b/toolbox/commands/copy_glossary.py index dea32cd..79ebb6f 100644 --- a/toolbox/commands/copy_glossary.py +++ b/toolbox/commands/copy_glossary.py @@ -1,4 +1,3 @@ -import logging from typing import Optional from toolbox.api.datagalaxy_api import get_access_token, Token, DataGalaxyBulkResult @@ -43,7 +42,6 @@ def copy_glossary(url_source: str, ) workspace_source_glossary_properties = glossary_on_source_workspace.list_properties( workspace_source_name) - logging.info(f'glossary properties on source workspace : {workspace_source_glossary_properties}') # on copie ces propriétés sur le workspace_target glossary_on_target_workspace = DataGalaxyApiGlossary( url=url_target, diff --git a/toolbox/commands/copy_usages.py b/toolbox/commands/copy_usages.py index 4d0e02a..8dc1c22 100644 --- a/toolbox/commands/copy_usages.py +++ b/toolbox/commands/copy_usages.py @@ -1,4 +1,3 @@ -import logging from typing import Optional from toolbox.api.datagalaxy_api import get_access_token, Token, DataGalaxyBulkResult @@ -44,7 +43,6 @@ def copy_usages(url_source: str, if workspaces_api_on_target_env.get_workspace(workspace_target_name): # on récupère les usages du workspace_source workspace_source_usages = usages_on_source_workspace.list_usages(workspace_source_name) - logging.info(f'Usages on source workspace : {workspace_source_usages}') # on copie ces usages sur le workspace_target return usages_on_target_workspace.bulk_upsert_usages_tree(