-
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.
[DOP-22348] Add transformations for Transfers with dataframe row filt…
…ering
- Loading branch information
Ilyas Gasanov
committed
Jan 15, 2025
1 parent
9b79921
commit d0eaf83
Showing
34 changed files
with
1,033 additions
and
120 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 @@ | ||
Add transformations for **Transfers** with dataframe row filtering |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# SPDX-FileCopyrightText: 2023-2024 MTS PJSC | ||
# SPDX-License-Identifier: Apache-2.0 |
86 changes: 86 additions & 0 deletions
86
syncmaster/schemas/v1/transfers/transformations/dataframe_rows_filter.py
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,86 @@ | ||
# SPDX-FileCopyrightText: 2023-2024 MTS PJSC | ||
# SPDX-License-Identifier: Apache-2.0 | ||
from typing import Annotated, Literal | ||
|
||
from pydantic import BaseModel, Field | ||
|
||
from syncmaster.schemas.v1.transformation_types import DATAFRAME_ROWS_FILTER | ||
|
||
|
||
class BaseRowFilter(BaseModel): | ||
field: str | ||
|
||
|
||
class EqualFilter(BaseRowFilter): | ||
type: Literal["equal"] | ||
value: str | None = None | ||
|
||
|
||
class NotEqualFilter(BaseRowFilter): | ||
type: Literal["not_equal"] | ||
value: str | None = None | ||
|
||
|
||
class GreaterThanFilter(BaseRowFilter): | ||
type: Literal["greater_than"] | ||
value: str | ||
|
||
|
||
class GreaterOrEqualFilter(BaseRowFilter): | ||
type: Literal["greater_or_equal"] | ||
value: str | ||
|
||
|
||
class LessThanFilter(BaseRowFilter): | ||
type: Literal["less_than"] | ||
value: str | ||
|
||
|
||
class LessOrEqualFilter(BaseRowFilter): | ||
type: Literal["less_or_equal"] | ||
value: str | ||
|
||
|
||
class LikeFilter(BaseRowFilter): | ||
type: Literal["like"] | ||
value: str | ||
|
||
|
||
class ILikeFilter(BaseRowFilter): | ||
type: Literal["ilike"] | ||
value: str | ||
|
||
|
||
class NotLikeFilter(BaseRowFilter): | ||
type: Literal["not_like"] | ||
value: str | ||
|
||
|
||
class NotILikeFilter(BaseRowFilter): | ||
type: Literal["not_ilike"] | ||
value: str | ||
|
||
|
||
class RegexpFilter(BaseRowFilter): | ||
type: Literal["regexp"] | ||
value: str | ||
|
||
|
||
RowFilter = ( | ||
EqualFilter | ||
| NotEqualFilter | ||
| GreaterThanFilter | ||
| GreaterOrEqualFilter | ||
| LessThanFilter | ||
| LessOrEqualFilter | ||
| LikeFilter | ||
| ILikeFilter | ||
| NotLikeFilter | ||
| NotILikeFilter | ||
| RegexpFilter | ||
) | ||
|
||
|
||
class DataframeRowsFilter(BaseModel): | ||
type: DATAFRAME_ROWS_FILTER | ||
filters: list[Annotated[RowFilter, Field(..., discriminator="type")]] = Field(default_factory=list) |
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,5 @@ | ||
# SPDX-FileCopyrightText: 2023-2024 MTS PJSC | ||
# SPDX-License-Identifier: Apache-2.0 | ||
from typing import Literal | ||
|
||
DATAFRAME_ROWS_FILTER = Literal["dataframe_rows_filter"] |
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.