Requires version
0.9.23 or greater.Using block variables
Block variables can be accessed via thekwargs parameter in your block function.
The variables are stored in a block’s configuration, which is accessible through
kwargs['configuration'].
Supported block types
Block variables are currently only supported for Python blocks with the following block types:data_loadertransformerdata_exportercustomsensor
Creating block variables
In Mage UI
You can create new block variables from the Mage UI through the “Block settings” tab in the Sidekick of the Pipeline Editor page. The block settings can also be quickly accessed by clicking the settings icon in a block’s header. In the “Block variables” section of the block settings, click the+ New button, enter
the variable’s name and value in the input fields and then press Enter or Return on
your keyboard while still focused on one of the input fields (this step can be repeated
multiple times).
This will add the variable(s), but not save it. You need to also click the blue
Update block settings button below the “Block variables” section in order to save
and persist these new variables. You can also edit/delete existing block variables by
hovering over a variable and clicking the edit/trash icons. You can press the Escape
key to exit a variable’s edit mode.
In code
You can also create or edit block variables by going to a pipeline’smetadata.yaml file
(located in the pipelines/[pipeline_uuid] directory) and adding them to a block’s
configuration property.