Skip to content

Commit 5da46eb

Browse files
Fix enum conditional for env parsing (#137)
* Refactoring changed file names * Roll version * Update src/unstract/sdk/utils/tool_utils.py Co-authored-by: Chandrasekharan M <[email protected]> Signed-off-by: Gayathri <[email protected]> * Update tests/test_fs_permanent.py Co-authored-by: Chandrasekharan M <[email protected]> Signed-off-by: Gayathri <[email protected]> * Update tests/test_fs_permanent.py Co-authored-by: Chandrasekharan M <[email protected]> Signed-off-by: Gayathri <[email protected]> * Update src/unstract/sdk/utils/tool_utils.py Co-authored-by: Chandrasekharan M <[email protected]> Signed-off-by: Gayathri <[email protected]> * 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 --------- Signed-off-by: Gayathri <[email protected]> Co-authored-by: Chandrasekharan M <[email protected]>
1 parent 8a22759 commit 5da46eb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/unstract/sdk/file_storage/env_helper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ def get_storage(storage_type: StorageType, env_name: str) -> FileStorage:
3737
file_storage_creds[CredentialKeyword.PROVIDER]
3838
)
3939
credentials = file_storage_creds.get(CredentialKeyword.CREDENTIALS, "{}")
40-
if storage_type == StorageType.PERMANENT.value:
40+
if storage_type == StorageType.PERMANENT:
4141
file_storage = PermanentFileStorage(provider=provider, **credentials)
42-
elif storage_type == StorageType.TEMPORARY.value:
42+
elif storage_type == StorageType.TEMPORARY:
4343
file_storage = SharedTemporaryFileStorage(
4444
provider=provider, **credentials
4545
)

tests/test_file_storage.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -756,12 +756,12 @@ def test_glob(file_storage, folder_path, expected_result):
756756
"storage_type, env_name, expected",
757757
[
758758
(
759-
StorageType.PERMANENT.value,
759+
StorageType.PERMANENT,
760760
"TEST_PERMANENT_STORAGE",
761761
FileStorageProvider.GCS,
762762
),
763763
(
764-
StorageType.TEMPORARY.value,
764+
StorageType.TEMPORARY,
765765
"TEST_TEMPORARY_STORAGE",
766766
FileStorageProvider.MINIO,
767767
),

0 commit comments

Comments
 (0)