MCPcopy Create free account
hub / github.com/dask/dask / find_operations

Method find_operations

dask/_expr.py:813–832  ·  view source on GitHub ↗

Search the expression graph for a specific operation type Parameters ---------- operation The operation type to search for. Returns ------- nodes Generator of `operation` instances. Ordering corresponds to a depth-

(self, operation: type | tuple[type])

Source from the content-addressed store, hash-verified

811 yield node
812
813 def find_operations(self, operation: type | tuple[type]) -> Generator[Expr]:
814 """Search the expression graph for a specific operation type
815
816 Parameters
817 ----------
818 operation
819 The operation type to search for.
820
821 Returns
822 -------
823 nodes
824 Generator of `operation` instances. Ordering corresponds
825 to a depth-first search of the expression graph.
826 """
827 assert (
828 isinstance(operation, tuple)
829 and all(issubclass(e, Expr) for e in operation)
830 or issubclass(operation, Expr) # type: ignore
831 ), "`operation` must be`Expr` subclass)"
832 return (expr for expr in self.walk() if isinstance(expr, operation))
833
834 def __getattr__(self, key):
835 try:

Callers 15

_get_culled_divisionsMethod · 0.80
to_parquetFunction · 0.80
test_parquet_len_filterFunction · 0.80
test_combine_similarFunction · 0.80
test_groupby_split_everyFunction · 0.80
test_groupby_applyFunction · 0.80
test_groupby_transformFunction · 0.80
test_groupby_shiftFunction · 0.80
test_combine_similarFunction · 0.80

Calls 2

walkMethod · 0.95
allFunction · 0.85