from ppc_robot_lib.steps import AbstractStep
from ppc_robot_lib.tasks import TaskContextInterface
[docs]
class AddClientIdStep(AbstractStep):
"""
Add a new column to the table that contains with Client ID from task context.
**Example:**
>>> from ppc_robot_lib.steps.transformations import AddClientIdStep
>>> AddClientIdStep("table", "client_id")
"""
def __init__(self, table: str, column: str):
"""
:param table: Table to use.
:param column: Column to add.
"""
self.table = table
self.column = column
def execute(self, task_ctx: TaskContextInterface) -> None:
table = task_ctx.work_set.get_table(self.table)
table[self.column] = task_ctx.client_id