A Python transformation can have input and output ports.
To create and edit ports for a non-reusable Python transformation, use the
Ports
tab in the editor. To create and edit ports for a reusable Python transformation, use the
Overview
view in the editor. After you add ports to the transformation, you can use the port names as variables in the Python code.
Use the following guidelines to create input and output ports:
The port name can contain only ASCII characters.
The port name cannot be a Python keyword. For example, do not use port names such as
import, global
or
class
.
The port name cannot be
resourceJepFile
or
resourceFilesArray
.
You cannot configure user-defined default values in output ports in the Python transformation. Set user-defined default values in the Python code.
For example, you can write
output_port = 'value'
to set the default value
'value'
for the output port
output_port
.
You can enable one or more input rows as partition keys. The Data Integration Service uses the partition keys to repartition the data before the code runs. If you do not select an input row as a partition key, the data is processed using its default partitioning scheme.