DAGExecution
Bases: Generic[P, RVDAG]
A disposable callable instance of a DAG.
It holds information about the last execution. Hence it is not threadsafe. It might be reusable, however it is not recommended to reuse an instance of DAGExecutor!.
Source code in tawazi/_dag/dag.py
848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 |
|
__init__(dag, *, target_nodes=None, exclude_nodes=None, cache_deps_of=None, cache_in='', from_cache='', call_id=None)
¶
Constructor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dag |
DAG
|
The attached DAG. |
required |
target_nodes |
Optional[List[Alias]]
|
The leave ExecNodes to execute. If None will execute all ExecNodes. Defaults to None. |
None
|
exclude_nodes |
Optional[List[Alias]]
|
The leave ExecNodes to exclude. If None will exclude all ExecNodes. Defaults to None. |
None
|
cache_deps_of |
Optional[List[Alias]]
|
cache all the dependencies of these nodes. This option can not be used together with target_nodes nor exclude_nodes. |
None
|
cache_in |
str
|
the path to the file where the execution should be cached.
The path should end in |
''
|
from_cache |
str
|
the path to the file where the execution should be loaded from.
The path should end in |
''
|
call_id |
Optional[str]
|
identification of the current execution. This will be inserted into thread_name_prefix while executing the threadPool. It will be used in the future for identifying the execution inside Processes etc. |
None
|
Source code in tawazi/_dag/dag.py
__call__(*args, **kwargs)
¶
Call the DAG.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
*args |
P.args
|
positional arguments to pass in to the DAG |
()
|
**kwargs |
P.kwargs
|
keyword arguments to pass in to the DAG |
{}
|
Raises:
Type | Description |
---|---|
TawaziUsageError
|
if the DAGExecution has already been executed. |
Returns:
Name | Type | Description |
---|---|---|
RVDAG |
RVDAG
|
the return value of the DAG's Execution |
Source code in tawazi/_dag/dag.py
1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 |
|
setup()
¶
Does the same thing as DAG.setup. However the target_nodes
and exclude_nodes
are taken from the DAGExecution's initization.
Source code in tawazi/_dag/dag.py
get_node_by_id(id_)
¶
Get node with the given id.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id_ |
Identifier
|
id of the ExecNode |
required |
Returns:
Name | Type | Description |
---|---|---|
ExecNode |
ExecNode
|
Corresponding ExecNode |
Source code in tawazi/_dag/dag.py
get_nodes_by_tag(tag)
¶
Get all the nodes with the given tag.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tag |
Tag
|
tag of ExecNodes in question |
required |
Returns:
Type | Description |
---|---|
List[ExecNode]
|
List[ExecNode]: corresponding ExecNodes |