from ppc_robot_lib.steps import AbstractStep
from ppc_robot_lib.tasks import TaskContextInterface
[docs]
class DeleteTableStep(AbstractStep):
"""
Deletes a table with the given name.
**Example:**
>>> from ppc_robot_lib.steps.control import DeleteTableStep
>>> DeleteTableStep("unnecessary_table")
"""
def __init__(self, table: str | list[str]):
self.table = table
def execute(self, task_ctx: TaskContextInterface) -> None:
if isinstance(self.table, list):
for table in self.table:
task_ctx.work_set.delete_table(table)
else:
task_ctx.work_set.delete_table(self.table)
def get_label_args(self):
return self.table