merged dependencies for mergable operations
This commit is contained in:
parent
c05760b767
commit
54920a2f54
1 changed files with 6 additions and 0 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
import operator
|
||||||
|
from functools import reduce
|
||||||
from itertools import chain
|
from itertools import chain
|
||||||
from typing import Type, Any, Optional, Annotated, Union
|
from typing import Type, Any, Optional, Annotated, Union
|
||||||
|
|
||||||
|
@ -62,6 +64,10 @@ class SingleOperationWithDependencies(BaseSchema):
|
||||||
class MergableOperationsWithDependencies(BaseSchema):
|
class MergableOperationsWithDependencies(BaseSchema):
|
||||||
children: list[SingleOperationWithDependencies]
|
children: list[SingleOperationWithDependencies]
|
||||||
|
|
||||||
|
@property
|
||||||
|
def dependencies(self) -> set[OperationDependency]:
|
||||||
|
return reduce(operator.or_, (c.dependencies for c in self.children), set())
|
||||||
|
|
||||||
|
|
||||||
OperationWithDependencies = Union[
|
OperationWithDependencies = Union[
|
||||||
SingleOperationWithDependencies,
|
SingleOperationWithDependencies,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue