Skip to content

Commit b1c3443

Browse files
committed
[DOP-14025] Remove pathlib.PurePosixPath from API schemas
1 parent c4366f9 commit b1c3443

5 files changed

Lines changed: 3 additions & 29 deletions

File tree

syncmaster/backend/api/v1/router.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from syncmaster.backend.api.v1.connections import router as connection_router
77
from syncmaster.backend.api.v1.groups import router as group_router
88
from syncmaster.backend.api.v1.queue import router as queue_router
9-
from syncmaster.backend.api.v1.transfers.router import router as transfer_router
9+
from syncmaster.backend.api.v1.transfers import router as transfer_router
1010
from syncmaster.backend.api.v1.users import router as user_router
1111

1212
router = APIRouter(prefix="/v1")

syncmaster/backend/api/v1/transfers/router.py renamed to syncmaster/backend/api/v1/transfers.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
from kombu.exceptions import KombuError
77

88
from syncmaster.backend.api.deps import UnitOfWorkMarker
9-
from syncmaster.backend.api.v1.transfers.utils import (
10-
process_file_transfer_directory_path,
11-
)
129
from syncmaster.backend.services import UnitOfWork, get_user
1310
from syncmaster.db.models import Status, User
1411
from syncmaster.db.utils import Permission
@@ -115,8 +112,6 @@ async def create_transfer(
115112
if transfer_data.group_id != queue.group_id:
116113
raise DifferentTransferAndQueueGroupError
117114

118-
transfer_data = process_file_transfer_directory_path(transfer_data) # type: ignore
119-
120115
async with unit_of_work:
121116
transfer = await unit_of_work.transfer.create(
122117
group_id=transfer_data.group_id,
@@ -316,8 +311,6 @@ async def update_transfer(
316311
params_type=transfer_data.source_params.type,
317312
)
318313

319-
transfer_data = process_file_transfer_directory_path(transfer_data) # type: ignore
320-
321314
async with unit_of_work:
322315
transfer = await unit_of_work.transfer.update(
323316
transfer=transfer,

syncmaster/backend/api/v1/transfers/__init__.py

Lines changed: 0 additions & 2 deletions
This file was deleted.

syncmaster/backend/api/v1/transfers/utils.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

syncmaster/schemas/v1/transfers/file/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class ReadFileTransferTarget(BaseModel):
2828
# At the moment the CreateTransferSourceParams and CreateTransferTargetParams
2929
# classes are identical but may change in the future
3030
class CreateFileTransferSource(BaseModel):
31-
directory_path: PurePosixPath
31+
directory_path: str
3232
file_format: CSV | JSONLine | JSON = Field(..., discriminator="type")
3333

3434
class Config:
@@ -38,7 +38,7 @@ class Config:
3838

3939

4040
class CreateFileTransferTarget(BaseModel):
41-
directory_path: PurePosixPath
41+
directory_path: str
4242
file_format: CSV | JSONLine = Field(..., discriminator="type") # JSON FORMAT IS NOT SUPPORTED AS A TARGET !
4343

4444
class Config:

0 commit comments

Comments
 (0)