Skip to content

Commit d415bd9

Browse files
Marvin Schenkelarjendev
authored andcommitted
feat: add the option to add an error to an ActivityResult
1 parent 0315a3a commit d415bd9

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/data_factory_testing_framework/_pythonnet/data_factory_testing_framework_expressions_evaluator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def evaluate(expression: str, state: PipelineRunState) -> Union[str, int, float,
4242
"body": {
4343
"output": activity.output,
4444
"status": activity.status,
45+
"error": activity.error,
4546
}
4647
}
4748
}

src/data_factory_testing_framework/state/_activity_result.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,20 @@ def __init__(
99
activity_name: str,
1010
status: Optional[DependencyCondition] = None,
1111
output: Optional[Any] = None, # noqa: ANN401
12+
error: Optional[Any] = None, # noqa: ANN401
1213
) -> None:
1314
"""Represents the result of an activity.
1415
1516
Args:
1617
activity_name: Name of the activity.
1718
status: Status of the activity.
1819
output: Output of the activity. (e.g. { "count": 1 } for activity('activityName').output.count)
20+
error: Error of the activity. (e.g. { "code": "ErrorCode", "message": "ErrorMessage" } for activity('activityName').Error)
1921
"""
2022
self.activity_name = activity_name
2123
self.status = status if status is not None else DependencyCondition.SUCCEEDED
2224
self.output = output
25+
self.error = error
2326

2427
def __getitem__(self, item: str) -> Any: # noqa: ANN401
2528
return getattr(self, item)

0 commit comments

Comments
 (0)