MCPcopy Create free account
hub / github.com/apache/devlake / _get_last_state

Method _get_last_state

backend/python/pydevlake/pydevlake/subtasks.py:116–127  ·  view source on GitHub ↗
(self, session, connection_id)

Source from the content-addressed store, hash-verified

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)

Callers 1

runMethod · 0.95

Calls 1

execMethod · 0.45

Tested by

no test coverage detected