task
DagTaskBreakdown
Bases: Enum
Enum to define how to break down a graph into tasks for the pipeline.
Source code in lineapy/plugins/task.py
179 180 181 182 183 184 185 186 |
|
TaskDefinition
dataclass
Definition of an artifact, can extend new keys(user, project, ...) in the future.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
function_name |
str
|
suggested function name this task that wont conflict with other linea generated tasks |
required |
user_input_variables |
List[str]
|
arguments that must be provided through the framework |
required |
loaded_input_variables |
List[str]
|
arguments that are provided by other tasks and must be loaded through inter task communication |
required |
typing_blocks |
List[str]
|
for user_input_variables, casts the input variables to the correct type |
required |
call_block |
str
|
line of code to call the function in module file |
required |
return_vars |
List[str]
|
outputs that need to be serialized to be used |
required |
pipeline_name |
str
|
overall pipeline name |
required |
Source code in lineapy/plugins/task.py
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 |
|
TaskGraph
Bases: object
Graph represents for task dependency It is constructed based on the "edges" variable
Parameters:
Name | Type | Description | Default |
---|---|---|---|
edges |
TaskGraphEdge
|
Dictionary with task name as key and set of prerequisite
tasks as value. This is the standard library A ---\ \
|
{}
|
Note
- If we only support Python 3.9+, we prefer to use graphlib in standard library instead of networkx for graph operation.
- We might want to get rid of the mapping for renaming slice_names to task_names.
Source code in lineapy/plugins/task.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
|
insert_setup_task(setup_task_name)
insert_setup_task adds a setup task that will be run before all the original source tasks
Source code in lineapy/plugins/task.py
77 78 79 80 81 82 83 84 85 86 |
|
insert_teardown_task(cleanup_task_name)
insert_cleanup_task adds a cleanup task that will be run after all the original sink tasks
Source code in lineapy/plugins/task.py
88 89 90 91 92 93 94 95 96 97 |
|
TaskSerializer
Bases: Enum
Enum to define what type of object serialization to use for inter task communication.
Source code in lineapy/plugins/task.py
189 190 191 192 193 194 195 |
|
render_task_io_serialize_blocks(taskdef, task_serialization)
render_task_io_serialize_blocks renders object ser and deser code blocks.
These code blocks can be used for inter task communication. This function returns the task deserialization block first, since this block should be included first in the function to load the variables.
Source code in lineapy/plugins/task.py
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 |
|