Skip to content

Commit 50240e5

Browse files
GitHKAndrei Neagusanderegg
authored
Fixing wrong file name (#2197)
* added API call to query metadata entries * exposing to data_mater * added tests * fixing check * added more debugging * this should really be working * removing pointless statement * figuring out types * checking before uploading * using correct object * no need to assert this * assert it dose not exsit * Update packages/simcore-sdk/src/simcore_sdk/node_data/data_manager.py Co-authored-by: Sylvain <[email protected]> * applied renaming * patching wrong name Co-authored-by: Andrei Neagu <[email protected]> Co-authored-by: Sylvain <[email protected]>
1 parent 0190de4 commit 50240e5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

packages/simcore-sdk/src/simcore_sdk/node_data/data_manager.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,16 @@ async def _pull_file(file_path: Path):
5757
log.info("%s successfuly pulled", file_path)
5858

5959

60+
def _get_archive_name(path: Path) -> str:
61+
return f"{path.stem}.zip"
62+
63+
6064
async def pull(file_or_folder: Path):
6165
if file_or_folder.is_file():
6266
return await _pull_file(file_or_folder)
6367
# we have a folder, so we need somewhere to extract it to
6468
with TemporaryDirectory() as tmp_dir_name:
65-
archive_file = Path(tmp_dir_name) / "{}.zip".format(file_or_folder.stem)
69+
archive_file = Path(tmp_dir_name) / _get_archive_name(file_or_folder)
6670
await _pull_file(archive_file)
6771
log.info("extracting data from %s", archive_file)
6872
await unarchive_dir(
@@ -75,7 +79,8 @@ async def is_file_present_in_storage(file_path: Path) -> bool:
7579
"""
7680
:retruns True if an entry is present inside the files_metadata else False
7781
"""
82+
archive_nme = _get_archive_name(file_path)
7883
return await filemanager.entry_exists(
7984
store_id=0, # this is for simcore.s3
80-
s3_object=_create_s3_object(file_path),
85+
s3_object=archive_nme,
8186
)

0 commit comments

Comments
 (0)