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 @@ -73,32 +73,32 @@ sidebar_position: 1
7373
7474 - This section imports and initializes the node.
7575
76- ``` python
77- from dora import Node
78- import pyarrow as pa
76+ ``` python
77+ from dora import Node
78+ import pyarrow as pa
7979
80- def main ():
81- node = Node()
82- ```
80+ def main ():
81+ node = Node()
82+ ```
8383
8484 - 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 .
8585
86- ``` python
87- for event in node:
88- if event[" type" ] == " INPUT" :
89- print (
90- f """ Node received:
91- id: { event[" id" ]} ,
92- value: { event[" value" ]} ,
93- metadata: { event[" metadata" ]} """
94- )
95- ```
86+ ```python
87+ for event in node:
88+ if event[" type" ] == " INPUT" :
89+ print (
90+ f """ Node received:
91+ id: { event[" id" ]} ,
92+ value: { event[" value" ]} ,
93+ metadata: { event[" metadata" ]} """
94+ )
95+ ```
9696
9797 - This line send an output to other nodes.
9898
99- ``` python
100- node.send_output(" speech" , pa.array([" Hello World" ])) # add this line
101- ```
99+ ```python
100+ node.send_output(" speech" , pa.array([" Hello World" ])) # add this line
101+ ```
102102
103103 - We are using the `send_output` method to send a string as an arrow array to the listener node.
104104 - 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