ddeutil-workflow 0.0.56__py3-none-any.whl → 0.0.57__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ddeutil/workflow/__about__.py +1 -1
- ddeutil/workflow/__cron.py +26 -12
- ddeutil/workflow/__types.py +1 -0
- ddeutil/workflow/conf.py +20 -8
- ddeutil/workflow/event.py +1 -0
- ddeutil/workflow/exceptions.py +33 -12
- ddeutil/workflow/job.py +81 -57
- ddeutil/workflow/logs.py +13 -5
- ddeutil/workflow/result.py +9 -4
- ddeutil/workflow/scheduler.py +6 -2
- ddeutil/workflow/stages.py +370 -147
- ddeutil/workflow/utils.py +37 -6
- ddeutil/workflow/workflow.py +205 -230
- {ddeutil_workflow-0.0.56.dist-info → ddeutil_workflow-0.0.57.dist-info}/METADATA +41 -35
- ddeutil_workflow-0.0.57.dist-info/RECORD +31 -0
- {ddeutil_workflow-0.0.56.dist-info → ddeutil_workflow-0.0.57.dist-info}/WHEEL +1 -1
- ddeutil_workflow-0.0.56.dist-info/RECORD +0 -31
- {ddeutil_workflow-0.0.56.dist-info → ddeutil_workflow-0.0.57.dist-info}/entry_points.txt +0 -0
- {ddeutil_workflow-0.0.56.dist-info → ddeutil_workflow-0.0.57.dist-info}/licenses/LICENSE +0 -0
- {ddeutil_workflow-0.0.56.dist-info → ddeutil_workflow-0.0.57.dist-info}/top_level.txt +0 -0
ddeutil/workflow/result.py
CHANGED
@@ -37,6 +37,14 @@ class Status(IntEnum):
|
|
37
37
|
SKIP: int = 3
|
38
38
|
CANCEL: int = 4
|
39
39
|
|
40
|
+
@property
|
41
|
+
def emoji(self) -> str:
|
42
|
+
"""Return the emoji value of this status.
|
43
|
+
|
44
|
+
:rtype: str
|
45
|
+
"""
|
46
|
+
return {0: "✅", 1: "❌", 2: "🟡", 3: "⏩", 4: "🚫"}[self.value]
|
47
|
+
|
40
48
|
|
41
49
|
SUCCESS = Status.SUCCESS
|
42
50
|
FAILED = Status.FAILED
|
@@ -46,10 +54,7 @@ CANCEL = Status.CANCEL
|
|
46
54
|
|
47
55
|
|
48
56
|
@dataclass(
|
49
|
-
config=ConfigDict(
|
50
|
-
arbitrary_types_allowed=True,
|
51
|
-
use_enum_values=True,
|
52
|
-
),
|
57
|
+
config=ConfigDict(arbitrary_types_allowed=True, use_enum_values=True),
|
53
58
|
)
|
54
59
|
class Result:
|
55
60
|
"""Result Pydantic Model for passing and receiving data context from any
|
ddeutil/workflow/scheduler.py
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
# Licensed under the MIT License. See LICENSE in the project root for
|
4
4
|
# license information.
|
5
5
|
# ------------------------------------------------------------------------------
|
6
|
-
# [x] Use dynamic config
|
7
6
|
"""The main schedule running is `schedule_runner` function that trigger the
|
8
7
|
multiprocess of `schedule_control` function for listing schedules on the
|
9
8
|
config by `Loader.finds(Schedule)`.
|
@@ -17,6 +16,11 @@ functions; `workflow_task`, and `workflow_monitor`.
|
|
17
16
|
The `schedule_task` will run `task.release` method in threading object
|
18
17
|
for multithreading strategy. This `release` method will run only one crontab
|
19
18
|
value with the on field.
|
19
|
+
|
20
|
+
Steps:
|
21
|
+
- Extract all schedule config on the conf path.
|
22
|
+
- Slice schedules to multiprocess
|
23
|
+
- Start running task.
|
20
24
|
"""
|
21
25
|
from __future__ import annotations
|
22
26
|
|
@@ -699,7 +703,7 @@ def schedule_control(
|
|
699
703
|
:rtype: Result
|
700
704
|
"""
|
701
705
|
audit: type[Audit] = audit or get_audit(extras=extras)
|
702
|
-
result: Result = Result
|
706
|
+
result: Result = Result.construct_with_rs_or_id(parent_run_id=parent_run_id)
|
703
707
|
|
704
708
|
# NOTE: Create the start and stop datetime.
|
705
709
|
start_date: datetime = datetime.now(tz=dynamic("tz", extras=extras))
|