Login

How to use the Python live task in gws_core 0.5.X ?

JP
Jonathan Plassais
Feb 12, 2024

In the version 0.5.X of gws_core (0.5.0, 0.5.1, and 0.5.2), we improved the live tasks and in particular the live task for Python. You can connect the task Python live task directly to a resource of type Table. By default, the following code is integrated and will work with any table.


# Import modules
from gws_core import Table
# access task method to log a messages
self.log_info_message('Transposing table')
# Transpose the input table
table: Table = source.transpose()
# set the new table a output or the live task
target = table

From the configuration menu, you can update this code with your own code to manipulate any data table. If you want to know more about how Live tasks work in Constella, you can look at this documentation page.