-
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 16, 2025
1 parent
9b79921
commit f65489b
Showing
41 changed files
with
1,187 additions
and
132 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 |
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
96 changes: 96 additions & 0 deletions
96
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,96 @@ | ||
# 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 IsNullFilter(BaseRowFilter): | ||
type: Literal["is_null"] | ||
|
||
|
||
class IsNotNullFilter(BaseRowFilter): | ||
type: Literal["is_not_null"] | ||
|
||
|
||
class EqualFilter(BaseRowFilter): | ||
type: Literal["equal"] | ||
value: str | ||
|
||
|
||
class NotEqualFilter(BaseRowFilter): | ||
type: Literal["not_equal"] | ||
value: str | ||
|
||
|
||
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 = ( | ||
IsNullFilter | ||
| IsNotNullFilter | ||
| 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
Oops, something went wrong.