From eb412f45efd0a6c058777bb05a1423a2a501b1c3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 26 Nov 2024 08:51:42 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../prompt_studio_core_v2/prompt_studio_helper.py | 2 +- backend/prompt_studio/prompt_studio_core_v2/views.py | 2 +- .../file_storage/helpers/prompt_studio_file_helper.py | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/backend/prompt_studio/prompt_studio_core_v2/prompt_studio_helper.py b/backend/prompt_studio/prompt_studio_core_v2/prompt_studio_helper.py index d968917fb..75a7f3f4f 100644 --- a/backend/prompt_studio/prompt_studio_core_v2/prompt_studio_helper.py +++ b/backend/prompt_studio/prompt_studio_core_v2/prompt_studio_helper.py @@ -60,8 +60,8 @@ from utils.file_storage.helpers.prompt_studio_file_helper import PromptStudioFileHelper from utils.local_context import StateStore -from unstract.core.pubsub_helper import LogPublisher from backend.constants import FeatureFlag +from unstract.core.pubsub_helper import LogPublisher from unstract.flags.feature_flag import check_feature_flag_status CHOICES_JSON = "/static/select_choices.json" diff --git a/backend/prompt_studio/prompt_studio_core_v2/views.py b/backend/prompt_studio/prompt_studio_core_v2/views.py index 394c7bf19..9c3a926e3 100644 --- a/backend/prompt_studio/prompt_studio_core_v2/views.py +++ b/backend/prompt_studio/prompt_studio_core_v2/views.py @@ -55,8 +55,8 @@ from utils.file_storage.helpers.prompt_studio_file_helper import PromptStudioFileHelper from utils.user_session import UserSessionUtils -from unstract.connectors.filesystems.local_storage.local_storage import LocalStorageFS from backend.constants import FeatureFlag +from unstract.connectors.filesystems.local_storage.local_storage import LocalStorageFS from unstract.flags.feature_flag import check_feature_flag_status from .models import CustomTool diff --git a/backend/utils/file_storage/helpers/prompt_studio_file_helper.py b/backend/utils/file_storage/helpers/prompt_studio_file_helper.py index a9ff6ef8f..94182db2a 100644 --- a/backend/utils/file_storage/helpers/prompt_studio_file_helper.py +++ b/backend/utils/file_storage/helpers/prompt_studio_file_helper.py @@ -49,7 +49,7 @@ def get_or_create_prompt_studio_subdirectory( def upload_for_ide( org_id: str, user_id: str, tool_id: str, uploaded_file: Any ) -> None: - """ Uploads the file to a remote storage + """Uploads the file to a remote storage Args: org_id (str): Organization ID @@ -75,8 +75,8 @@ def upload_for_ide( def fetch_file_contents( org_id: str, user_id: str, tool_id: str, file_name: str ) -> Union[bytes, str]: - """ Method to fetch file contents from the remote location. - The path is constructed in runtime based on the args """ + """Method to fetch file contents from the remote location. + The path is constructed in runtime based on the args""" fs_instance = FileStorageHelper.initialize_file_storage( type=FileStorageType.PERMANENT ) @@ -136,7 +136,7 @@ def fetch_file_contents( @staticmethod def delete_for_ide(org_id: str, user_id: str, tool_id: str, file_name: str) -> bool: - """ Method to delete file in remote while the corresponsing prompt + """Method to delete file in remote while the corresponsing prompt studio project is deleted or the file is removed from the file manager. This method handles deleted for related files as well.""" fs_instance = FileStorageHelper.initialize_file_storage( @@ -170,7 +170,7 @@ def delete_for_ide(org_id: str, user_id: str, tool_id: str, file_name: str) -> b def _find_files( fs: FileStorage, base_file_name: str, base_path: str, directories: list[str] ) -> list[str]: - """ This method is used to file files with the specific pattern + """This method is used to file files with the specific pattern determined using the list of directories passed and the base path. This is used to delete related(extract, metadata etc.) files generated for a specific prompt studio project."""