MCPcopy Index your code
hub / github.com/pathwaycom/pathway / add_operator

Method add_operator

python/pathway/internals/parse_graph.py:132–154  ·  view source on GitHub ↗

Adds an operator to current scope. Args: create_node: factory method creating an operator node, taking node id as a parameter. call_operator: operator callback

(
        self,
        create_node: Callable[[int], O],
        call_operator: Callable[[O], T],
        *,
        special: bool = False,
        require_error_log: bool = True,
    )

Source from the content-addressed store, hash-verified

130 return scope
131
132 def add_operator(
133 self,
134 create_node: Callable[[int], O],
135 call_operator: Callable[[O], T],
136 *,
137 special: bool = False,
138 require_error_log: bool = True,
139 ) -> T:
140 """Adds an operator to current scope.
141
142 Args:
143 create_node: factory method creating an operator node, taking node id as a parameter.
144 call_operator: operator callback
145 """
146 node = create_node(next(self.node_id_sequence))
147 node.set_graph(self)
148 if require_error_log and not self.error_log_stack:
149 self.add_error_log(global_log=True) # deferred global log creation
150 node.set_error_log(self.error_log_stack[-1] if require_error_log else None)
151 result = call_operator(node)
152 self._current_scope.add_node(node, special=special)
153 self.unused_operators = True
154 return result
155
156 def add_iterate(
157 self,

Callers 7

add_iterateMethod · 0.95
add_error_logMethod · 0.95
__call__Method · 0.80
table_from_datasourceFunction · 0.80
table_to_datasinkFunction · 0.80
wrapperFunction · 0.80
debugMethod · 0.80

Calls 4

add_error_logMethod · 0.95
set_graphMethod · 0.80
add_nodeMethod · 0.80
set_error_logMethod · 0.45

Tested by

no test coverage detected