Load analyses marked as evolution candidates. Args: limit: Max number of records. include_processed: If False (default), only return candidates whose suggestions have NOT been processed yet.
(
self, limit: int = 50, *, include_processed: bool = False,
)
| 828 | |
| 829 | @_db_retry() |
| 830 | def load_evolution_candidates( |
| 831 | self, limit: int = 50, *, include_processed: bool = False, |
| 832 | ) -> List[ExecutionAnalysis]: |
| 833 | """Load analyses marked as evolution candidates. |
| 834 | |
| 835 | Args: |
| 836 | limit: Max number of records. |
| 837 | include_processed: If False (default), only return candidates |
| 838 | whose suggestions have NOT been processed yet. |
| 839 | """ |
| 840 | with self._reader() as conn: |
| 841 | if include_processed: |
| 842 | where = "WHERE candidate_for_evolution=1" |
| 843 | else: |
| 844 | where = ( |
| 845 | "WHERE candidate_for_evolution=1 " |
| 846 | "AND evolution_processed_at IS NULL" |
| 847 | ) |
| 848 | rows = conn.execute( |
| 849 | f"SELECT * FROM execution_analyses {where} " |
| 850 | "ORDER BY timestamp DESC LIMIT ?", |
| 851 | (limit,), |
| 852 | ).fetchall() |
| 853 | return [self._to_analysis(conn, r) for r in reversed(rows)] |
| 854 | |
| 855 | @_db_retry() |
| 856 | def mark_evolution_processed(self, task_id: str) -> None: |
no test coverage detected