The Python code is the Python script that you write in the Python transformation to define how the transformation processes data. When you write Python code, you might reconstruct input variables, load a pre-trained model, and define output variables.
Use the following rules to write Python code:
To access input ports, call the input port name.
To set output ports, set the output port to a value. You must set the output port to a value for each output port that you define in the Python transformation.
To define how the transformation writes data from the input ports to output ports, set the output port to the value of the input port.
For example, write
output_port = input_port
to write the data from the input port
input_port
to the output port
output_port
.
To access the resource file path, use the variable
resourceJepFile
. Specify the resource file using an index such as
resourceJepFile[0]
.
When you run the Python transformation, the Data Integration Service does not validate the Python code.