From 6a48aed0340dd50fbbbc0c84515e683aaaf127da Mon Sep 17 00:00:00 2001 From: Gayathri <142381512+gaya3-zipstack@users.noreply.github.com> Date: Thu, 26 Dec 2024 12:28:57 +0530 Subject: [PATCH] [FIX] Include helper class under package and refactor function name (#138) * Refactoring changed file names * Roll version * Update src/unstract/sdk/utils/tool_utils.py Co-authored-by: Chandrasekharan M <117059509+chandrasekharan-zipstack@users.noreply.github.com> Signed-off-by: Gayathri <142381512+gaya3-zipstack@users.noreply.github.com> * Update tests/test_fs_permanent.py Co-authored-by: Chandrasekharan M <117059509+chandrasekharan-zipstack@users.noreply.github.com> Signed-off-by: Gayathri <142381512+gaya3-zipstack@users.noreply.github.com> * Update tests/test_fs_permanent.py Co-authored-by: Chandrasekharan M <117059509+chandrasekharan-zipstack@users.noreply.github.com> Signed-off-by: Gayathri <142381512+gaya3-zipstack@users.noreply.github.com> * Update src/unstract/sdk/utils/tool_utils.py Co-authored-by: Chandrasekharan M <117059509+chandrasekharan-zipstack@users.noreply.github.com> Signed-off-by: Gayathri <142381512+gaya3-zipstack@users.noreply.github.com> * Address review comments * Add support for passing length to mime_type * Add recursive and fix mypy issue * CHange test case with new behavior to return FileNotFound in read() * Remove typing kwargs. * Resolve mypy issues * Resolve mypy issues * Remove unwanted conditionals/vars * Remove pandoc and tessaract. * Details of provider added to error message * fixed enum conditional matching value * Include EnvHelper in __init__ * Rename error handler * Upgrade version * Expose StorageType outside --------- Signed-off-by: Gayathri <142381512+gaya3-zipstack@users.noreply.github.com> Co-authored-by: Chandrasekharan M <117059509+chandrasekharan-zipstack@users.noreply.github.com> --- src/unstract/sdk/__init__.py | 2 +- src/unstract/sdk/adapters/vectordb/qdrant/src/qdrant.py | 2 +- src/unstract/sdk/file_storage/__init__.py | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/unstract/sdk/__init__.py b/src/unstract/sdk/__init__.py index cdad6627..29bc6ab1 100644 --- a/src/unstract/sdk/__init__.py +++ b/src/unstract/sdk/__init__.py @@ -1,4 +1,4 @@ -__version__ = "0.54.0rc8" +__version__ = "0.54.0rc9" def get_sdk_version(): diff --git a/src/unstract/sdk/adapters/vectordb/qdrant/src/qdrant.py b/src/unstract/sdk/adapters/vectordb/qdrant/src/qdrant.py index 997eb21c..4a95d129 100644 --- a/src/unstract/sdk/adapters/vectordb/qdrant/src/qdrant.py +++ b/src/unstract/sdk/adapters/vectordb/qdrant/src/qdrant.py @@ -74,7 +74,7 @@ def _get_vector_db_instance(self) -> BasePydanticVectorStore: ) return vector_db except Exception as e: - raise self.parse_qdrant_err(e) from e + raise self.parse_vector_db_err(e) from e def test_connection(self) -> bool: try: diff --git a/src/unstract/sdk/file_storage/__init__.py b/src/unstract/sdk/file_storage/__init__.py index 6c20692b..99cd6fe3 100644 --- a/src/unstract/sdk/file_storage/__init__.py +++ b/src/unstract/sdk/file_storage/__init__.py @@ -4,8 +4,12 @@ "FileStorageHelper", "PermanentFileStorage", "SharedTemporaryFileStorage", + "EnvHelper", + "StorageType", ] +from unstract.sdk.file_storage.constants import StorageType +from unstract.sdk.file_storage.env_helper import EnvHelper from unstract.sdk.file_storage.helper import FileStorageHelper from unstract.sdk.file_storage.impl import FileStorage from unstract.sdk.file_storage.permanent import PermanentFileStorage