File tree Expand file tree Collapse file tree 6 files changed +13
-14
lines changed
models-library/src/models_library/api_schemas_webserver
service-library/src/servicelib/rabbitmq/rpc_interfaces/storage
src/simcore_service_storage Expand file tree Collapse file tree 6 files changed +13
-14
lines changed Original file line number Diff line number Diff line change 77 DEFAULT_NUMBER_OF_PATHS_PER_PAGE ,
88 MAX_NUMBER_OF_PATHS_PER_PAGE ,
99)
10- from ..projects_nodes_io import LocationID , StorageFileID
11- from ..rest_pagination import (
12- CursorQueryParameters ,
13- )
10+ from ..projects_nodes_io import LocationID
11+ from ..rest_pagination import CursorQueryParameters
1412from ._base import InputSchema
1513
1614
@@ -40,4 +38,4 @@ class BatchDeletePathsBodyParams(InputSchema):
4038
4139
4240class DataExportPost (InputSchema ):
43- paths : list [StorageFileID ]
41+ paths : list [str ]
Original file line number Diff line number Diff line change 44)
55from models_library .api_schemas_storage import STORAGE_RPC_NAMESPACE
66from models_library .api_schemas_storage .storage_schemas import FoldersBody
7- from models_library .projects_nodes_io import StorageFileID
87from models_library .rabbitmq_basic_types import RPCMethodName
98from models_library .users import UserID
109from pydantic import TypeAdapter
@@ -36,7 +35,7 @@ async def start_data_export(
3635 * ,
3736 user_id : UserID ,
3837 product_name : str ,
39- paths_to_export : list [StorageFileID ],
38+ paths_to_export : list [str ],
4039) -> tuple [AsyncJobGet , AsyncJobNameData ]:
4140 job_id_data = AsyncJobNameData (user_id = user_id , product_name = product_name )
4241 async_job_rpc_get = await submit (
Original file line number Diff line number Diff line change 1515from ...dsm import get_dsm_provider
1616from ...modules .celery .models import TaskID , TaskId
1717from ...modules .celery .utils import get_celery_worker , get_fastapi_app
18- from ...simcore_s3_dsm import SimcoreS3DataManager
18+ from ...simcore_s3_dsm import S3ObjectKey , SimcoreS3DataManager
1919from ...utils .progress_utils import get_tqdm_progress , set_tqdm_absolute_progress
2020
2121_logger = logging .getLogger (__name__ )
@@ -66,7 +66,7 @@ async def data_export(
6666 task_id : TaskID ,
6767 * ,
6868 user_id : UserID ,
69- paths_to_export : list [StorageFileID ],
69+ paths_to_export : list [S3ObjectKey ],
7070) -> StorageFileID :
7171 _logger .info ("Exporting (for user='%s') selection: %s" , user_id , paths_to_export )
7272
Original file line number Diff line number Diff line change 1+ from aws_library .s3 ._models import S3ObjectKey
12from fastapi import FastAPI
23from models_library .api_schemas_rpc_async_jobs .async_jobs import (
34 AsyncJobGet ,
45 AsyncJobNameData ,
56)
67from models_library .api_schemas_storage .storage_schemas import FoldersBody
7- from models_library .projects_nodes_io import StorageFileID
88from servicelib .rabbitmq import RPCRouter
99
1010from ...modules .celery import get_celery_client
@@ -31,7 +31,7 @@ async def copy_folders_from_project(
3131
3232@router .expose ()
3333async def start_data_export (
34- app : FastAPI , job_id_data : AsyncJobNameData , paths_to_export : list [StorageFileID ]
34+ app : FastAPI , job_id_data : AsyncJobNameData , paths_to_export : list [S3ObjectKey ]
3535) -> AsyncJobGet :
3636 task_uuid = await get_celery_client (app ).send_task (
3737 data_export .__name__ ,
Original file line number Diff line number Diff line change 1717 UploadedBytesTransferredCallback ,
1818 UploadID ,
1919)
20+ from aws_library .s3 ._models import S3ObjectKey
2021from fastapi import FastAPI
2122from models_library .api_schemas_storage .storage_schemas import (
2223 UNDEFINED_SIZE ,
@@ -1243,7 +1244,7 @@ async def _create_fmd_for_upload(
12431244 async def create_s3_export (
12441245 self ,
12451246 user_id : UserID ,
1246- object_keys : list [StorageFileID ],
1247+ object_keys : list [S3ObjectKey ],
12471248 * ,
12481249 progress_bar : ProgressBarData | None ,
12491250 ) -> StorageFileID :
Original file line number Diff line number Diff line change 99from typing import Any
1010
1111import pytest
12+ from aws_library .s3 ._models import S3ObjectKey
1213from faker import Faker
1314from models_library .basic_types import SHA256Str
1415from models_library .progress_bar import ProgressReport
@@ -194,7 +195,7 @@ async def paths_for_export(
194195
195196def _get_folder_and_files_selection (
196197 paths_for_export : set [SimcoreS3FileID ],
197- ) -> list [SimcoreS3FileID ]:
198+ ) -> list [S3ObjectKey ]:
198199 # select 10 % of files
199200
200201 random_files : list [SimcoreS3FileID ] = [
@@ -203,7 +204,7 @@ def _get_folder_and_files_selection(
203204 ]
204205
205206 all_containing_folders : set [SimcoreS3FileID ] = {
206- TypeAdapter (SimcoreS3FileID ).validate_python (f"{ Path (f ).parent } " )
207+ TypeAdapter (S3ObjectKey ).validate_python (f"{ Path (f ).parent } " )
207208 for f in random_files
208209 }
209210
You can’t perform that action at this time.
0 commit comments