-
Notifications
You must be signed in to change notification settings - Fork 22
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
4 changed files
with
13 additions
and
12 deletions.
There are no files selected for viewing
11 changes: 7 additions & 4 deletions
11
src/python/data_factory_testing_framework/models/data_factory_element.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 |
---|---|---|
@@ -1,12 +1,15 @@ | ||
from typing import Any, Generic, TypeVar | ||
from typing import Union | ||
|
||
from data_factory_testing_framework.functions.function_parser import parse_expression | ||
from data_factory_testing_framework.generated.models import DataFactoryElement | ||
from data_factory_testing_framework.models.state.run_state import RunState | ||
|
||
T = TypeVar("T") | ||
|
||
class DataFactoryElement(): | ||
def __init__(self) -> None: | ||
"""DataFactoryElement.""" | ||
self.value: Union[str, int, bool] = None | ||
|
||
class DataFactoryElement(Generic[T]): | ||
def evaluate(self: DataFactoryElement, state: Any) -> None: # noqa: ANN401 | ||
def evaluate(self: DataFactoryElement, state: RunState) -> None: | ||
self.value = parse_expression(self.expression).evaluate(state) | ||
return self.value |
8 changes: 3 additions & 5 deletions
8
src/python/data_factory_testing_framework/models/expression.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
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