-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
290 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from etl.dto.elasticsearch import * | ||
from etl.dto.postgres import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
from dataclasses import dataclass | ||
from uuid import UUID | ||
|
||
__all__ = [ | ||
"BaseElasticsearchRecord", | ||
"PersonMinimalElasticsearchRecord", | ||
"FilmWorkMinimalElasticsearchRecord", | ||
"GenreElasticsearchRecord", | ||
"PersonElasticsearchRecord", | ||
"FilmWorkElasticsearchRecord", | ||
] | ||
|
||
|
||
@dataclass | ||
class BaseElasticsearchRecord: | ||
"""Базовая модель для хранения информации в индексе Elasticsearch.""" | ||
|
||
id: UUID | ||
|
||
|
||
@dataclass | ||
class PersonMinimalElasticsearchRecord(BaseElasticsearchRecord): | ||
"""Модель для хранения краткой информации о персоне в индексе Elasticsearch.""" | ||
|
||
name: str | ||
|
||
|
||
@dataclass | ||
class FilmWorkMinimalElasticsearchRecord(BaseElasticsearchRecord): | ||
"""Модель для хранения краткой информации о кинопроизведении в индексе Elasticsearch.""" | ||
|
||
roles: list[str] | ||
|
||
|
||
@dataclass | ||
class GenreElasticsearchRecord(BaseElasticsearchRecord): | ||
"""Модель для хранения информации о жанре в индексе Elasticsearch.""" | ||
|
||
name: str | ||
description: str | ||
|
||
|
||
@dataclass | ||
class PersonElasticsearchRecord(BaseElasticsearchRecord): | ||
"""Модель для хранения информации о персоне в индексе Elasticsearch.""" | ||
|
||
full_name: str | ||
films: list[FilmWorkMinimalElasticsearchRecord] | ||
|
||
|
||
@dataclass | ||
class FilmWorkElasticsearchRecord(BaseElasticsearchRecord): | ||
"""Модель для хранения информации о кинопроизведении в индексе Elasticsearch.""" | ||
|
||
imdb_rating: float | ||
genre: list[str] | ||
title: str | ||
description: str | ||
director: list[str] | ||
actors_names: list[str] | ||
writers_names: list[str] | ||
actors: list[PersonMinimalElasticsearchRecord] | ||
writers: list[PersonMinimalElasticsearchRecord] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.