From 82f3a16a6e76e9903e201557d286f558c0eecae3 Mon Sep 17 00:00:00 2001 From: Rafik Nurmuhametov <113212617+raf-nr@users.noreply.github.com> Date: Wed, 25 Sep 2024 21:02:17 +0000 Subject: [PATCH] chore: remove data profiling and file response schemas --- internal/dto/repository/file/__init__.py | 1 - internal/dto/repository/file/file.py | 3 --- internal/dto/worker/task/profiling_task.py | 3 --- internal/repository/flat/file.py | 4 ++-- internal/usecase/file/save_file.py | 3 +-- tests/usecase/test_save_file.py | 5 +---- 6 files changed, 4 insertions(+), 15 deletions(-) diff --git a/internal/dto/repository/file/__init__.py b/internal/dto/repository/file/__init__.py index b1046036..749878b9 100644 --- a/internal/dto/repository/file/__init__.py +++ b/internal/dto/repository/file/__init__.py @@ -1,6 +1,5 @@ from internal.dto.repository.file.file import ( # noqa: F401 File, - FileResponseSchema, FileFindSchema, FileCreateSchema, FileUpdateSchema, diff --git a/internal/dto/repository/file/file.py b/internal/dto/repository/file/file.py index 4b1eb027..fdd16897 100644 --- a/internal/dto/repository/file/file.py +++ b/internal/dto/repository/file/file.py @@ -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] diff --git a/internal/dto/worker/task/profiling_task.py b/internal/dto/worker/task/profiling_task.py index 58ff8090..ced8a77d 100644 --- a/internal/dto/worker/task/profiling_task.py +++ b/internal/dto/worker/task/profiling_task.py @@ -11,6 +11,3 @@ class ProfilingTaskBaseSchema(BaseModel): class ProfilingTaskCreateSchema(ProfilingTaskBaseSchema): ... - - -ProfilingTaskResponseSchema = None diff --git a/internal/repository/flat/file.py b/internal/repository/flat/file.py index 115377a8..b9d669d7 100644 --- a/internal/repository/flat/file.py +++ b/internal/repository/flat/file.py @@ -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 @@ -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) diff --git a/internal/usecase/file/save_file.py b/internal/usecase/file/save_file.py index 0f6d2f5c..82c2cb2b 100644 --- a/internal/usecase/file/save_file.py +++ b/internal/usecase/file/save_file.py @@ -6,7 +6,6 @@ from internal.domain.file import File as FileEntity from internal.dto.repository.file import ( FileCreateSchema, - FileResponseSchema, File, FailedFileReadingException, ) @@ -22,7 +21,7 @@ class FileRepo(Protocol): async def create( self, file: File, file_info: FileCreateSchema, context: DataStorageContext - ) -> FileResponseSchema: ... + ) -> None: ... class FileMetadataRepo(Protocol): diff --git a/tests/usecase/test_save_file.py b/tests/usecase/test_save_file.py index ded91fc7..f67ba0ae 100644 --- a/tests/usecase/test_save_file.py +++ b/tests/usecase/test_save_file.py @@ -10,7 +10,6 @@ File, FileMetadataCreateSchema, FileCreateSchema, - FileResponseSchema, FailedFileReadingException, ) from internal.uow import UnitOfWork, DataStorageContext @@ -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)