Skip to content

Commit

Permalink
chore: remove data profiling and file response schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
raf-nr committed Sep 25, 2024
1 parent d36ab13 commit 82f3a16
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 15 deletions.
1 change: 0 additions & 1 deletion internal/dto/repository/file/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from internal.dto.repository.file.file import ( # noqa: F401
File,
FileResponseSchema,
FileFindSchema,
FileCreateSchema,
FileUpdateSchema,
Expand Down
3 changes: 0 additions & 3 deletions internal/dto/repository/file/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ class FileUpdateSchema(FileBaseSchema, BaseUpdateSchema): ...
class FileFindSchema(FileBaseSchema, BaseSchema): ... # it's not a typo


FileResponseSchema = None


class CSVFileFindSchema(FileFindSchema):
separator: str
header: list[int]
Expand Down
3 changes: 0 additions & 3 deletions internal/dto/worker/task/profiling_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,3 @@ class ProfilingTaskBaseSchema(BaseModel):


class ProfilingTaskCreateSchema(ProfilingTaskBaseSchema): ...


ProfilingTaskResponseSchema = None
4 changes: 2 additions & 2 deletions internal/repository/flat/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
CSVFileFindSchema,
CSVFileResponseSchema,
)
from internal.dto.repository.file import File, FileCreateSchema, FileResponseSchema
from internal.dto.repository.file import File, FileCreateSchema
from internal.infrastructure.data_storage.flat import FlatContext

CHUNK_SIZE = 1024
Expand All @@ -22,7 +22,7 @@ async def create(
file: File,
file_info: FileCreateSchema,
context: FlatContext,
) -> FileResponseSchema:
) -> None:

path_to_file = Path.joinpath(
context.upload_directory_path, str(file_info.file_name)
Expand Down
3 changes: 1 addition & 2 deletions internal/usecase/file/save_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from internal.domain.file import File as FileEntity
from internal.dto.repository.file import (
FileCreateSchema,
FileResponseSchema,
File,
FailedFileReadingException,
)
Expand All @@ -22,7 +21,7 @@ class FileRepo(Protocol):

async def create(
self, file: File, file_info: FileCreateSchema, context: DataStorageContext
) -> FileResponseSchema: ...
) -> None: ...


class FileMetadataRepo(Protocol):
Expand Down
5 changes: 1 addition & 4 deletions tests/usecase/test_save_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
File,
FileMetadataCreateSchema,
FileCreateSchema,
FileResponseSchema,
FailedFileReadingException,
)
from internal.uow import UnitOfWork, DataStorageContext
Expand Down Expand Up @@ -106,9 +105,7 @@ async def test_save_file(
updated_at=updated_at,
)

file_response = FileResponseSchema

file_repo_mock.create.return_value = file_response
file_repo_mock.create.return_value = None
file_metadata_repo_mock.create.return_value = file_metadata_response

upload_file_mock = mocker.Mock(spec=File)
Expand Down

0 comments on commit 82f3a16

Please sign in to comment.