Search for an ancestor that has a task with a spec of the specified name. Args: spec_name (str): the name of the spec associated with the task Returns: `Task`: the first result (or None, if no matching task was found)
(self, spec_name)
| 196 | return self.parent.is_descendant_of(task) |
| 197 | |
| 198 | def find_ancestor(self, spec_name): |
| 199 | """Search for an ancestor that has a task with a spec of the specified name. |
| 200 | |
| 201 | Args: |
| 202 | spec_name (str): the name of the spec associated with the task |
| 203 | |
| 204 | Returns: |
| 205 | `Task`: the first result (or None, if no matching task was found) |
| 206 | """ |
| 207 | if self.parent is None: |
| 208 | return None |
| 209 | if self.parent.task_spec.name == spec_name: |
| 210 | return self.parent |
| 211 | return self.parent.find_ancestor(spec_name) |
| 212 | |
| 213 | def _add_child(self, task_spec, state=TaskState.MAYBE): |
| 214 | """Adds a new child and assigns the given TaskSpec to it. |
no outgoing calls
no test coverage detected