Skip to content

Updateoperationalvars

flowtask.components.UpdateOperationalVars

UpdateOperationalVars

Overview

 This component updates operational variables stored in the `process_variables` table within the `troc` schema.
 It supports dynamic variable replacement and mask application, making it versatile for runtime updates in task flows.

.. table:: Properties :widths: auto

 +--------------+----------+-----------+---------------------------------------------------------------+
 | Name         | Required | Summary                                                                |
 +--------------+----------+-----------+---------------------------------------------------------------+
 | name         |   Yes    | The name of the variable to update.                                     |
 +--------------+----------+-----------+---------------------------------------------------------------+
 | value        |   Yes    | The new value to assign to the variable after the update.               |
 +--------------+----------+-----------+---------------------------------------------------------------+
 | masks        |   Yes    | Defines a section for dynamically setting the value of the variable.    |
 +--------------+----------+-----------+---------------------------------------------------------------+

Returns

 This component does not return data directly. Instead, it updates specified variables in the database and
 records metrics on the update status. Additionally, logging is provided for SQL execution, and potential errors
 are managed with detailed logging and exception handling for effective debugging.


 Example:

 ```yaml
 UpdateOperationalVars:
   name: EPSON_SALES
   value: '{saturday}'
   masks:
     '{saturday}':
     - date_diff_dow
     - diff: 2
       day_of_week: monday
       mask: '%Y-%m-%d'
 ```

UpdateOperationalVars

UpdateOperationalVars(loop=None, job=None, stat=None, **kwargs)