| 114 | pass |
| 115 | |
| 116 | def _get_last_state(self, session, connection_id): |
| 117 | stmt = ( |
| 118 | select(SubtaskRun) |
| 119 | .where(SubtaskRun.subtask_name == self.name) |
| 120 | .where(SubtaskRun.connection_id == connection_id) |
| 121 | .where(SubtaskRun.completed != None) |
| 122 | .order_by(sql.desc(SubtaskRun.started)) |
| 123 | ) |
| 124 | subtask_run = session.exec(stmt).first() |
| 125 | if subtask_run is not None: |
| 126 | return json.loads(subtask_run.state) |
| 127 | return {} |
| 128 | |
| 129 | def _params(self, ctx: Context) -> str: |
| 130 | return raw_data_params(ctx.connection.id, ctx.scope.id) |