File tree Expand file tree Collapse file tree 1 file changed +19
-19
lines changed
docs/guides/getting-started Expand file tree Collapse file tree 1 file changed +19
-19
lines changed Original file line number Diff line number Diff line change @@ -72,32 +72,32 @@ sidebar_position: 1
7272
7373 - This section imports and initializes the node.
7474
75- ``` python
76- from dora import Node
77- import pyarrow as pa
75+ ``` python
76+ from dora import Node
77+ import pyarrow as pa
7878
79- def main ():
80- node = Node()
81- ```
79+ def main ():
80+ node = Node()
81+ ```
8282
8383 - This part of the code checks to see if the node has received any input , and if it has, it will print out some data relating to the input .
8484
85- ``` python
86- for event in node:
87- if event[" type" ] == " INPUT" :
88- print (
89- f """ Node received:
90- id: { event[" id" ]} ,
91- value: { event[" value" ]} ,
92- metadata: { event[" metadata" ]} """
93- )
94- ```
85+ ```python
86+ for event in node:
87+ if event[" type" ] == " INPUT" :
88+ print (
89+ f """ Node received:
90+ id: { event[" id" ]} ,
91+ value: { event[" value" ]} ,
92+ metadata: { event[" metadata" ]} """
93+ )
94+ ```
9595
9696 - This line send an output to other nodes.
9797
98- ``` python
99- node.send_output(" speech" , pa.array([" Hello World" ])) # add this line
100- ```
98+ ```python
99+ node.send_output(" speech" , pa.array([" Hello World" ])) # add this line
100+ ```
101101
102102 - We are using the `send_output` method to send a string as an arrow array to the listener node.
103103 - The first argument is the id of the output we want to send to be referenced later in the dataflow.
You can’t perform that action at this time.
0 commit comments