File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22from collections import defaultdict
33from typing import cast
44
5- import click
65from psycopg import sql
76
87from app import log
@@ -215,14 +214,15 @@ def _resolve_batch(
215214 result = resolver .resolve (evidence )
216215 results .append ((record_id , result ))
217216 if print_pending and result .triage_status == TriageStatus .PENDING :
218- line = record_id + f"({ result .status } )"
219- if result .pending_reason is not None :
220- line += " " + result .pending_reason .value
221- if result .colliding_pgcs :
222- line += " pgcs: " + "," .join (str (p ) for p in sorted (result .colliding_pgcs ))
223- elif result .matched_pgc is not None :
224- line += " pgc: " + str (result .matched_pgc )
225- click .echo (line )
217+ log .logger .warning (
218+ "pending crossmatch" ,
219+ record_id = record_id ,
220+ status = result .status .value ,
221+ pending_reason = result .pending_reason .value if result .pending_reason is not None else None ,
222+ colliding_pgcs = sorted (result .colliding_pgcs ) if result .colliding_pgcs else None ,
223+ matched_pgc = result .matched_pgc ,
224+ link = f"https://leda.sao.ru/records/{ record_id } /crossmatch" ,
225+ )
226226 return results
227227
228228
Original file line number Diff line number Diff line change @@ -18,13 +18,13 @@ def query(
1818 params : Sequence [Any ] | None = None ,
1919 ) -> list [dict [str , Any ]]:
2020 query_str = query if isinstance (query , str ) else query .as_string (self ._conn )
21- log .logger .info ("Started query" , query = query_str )
21+ log .logger .debug ("Started query" , query = query_str )
2222 if isinstance (query , str ):
2323 query_exec : sql .SQL | sql .Composed = sql .SQL (cast (LiteralString , query ))
2424 else :
2525 query_exec = query
2626 with self ._conn .cursor (row_factory = dict_row ) as cur :
2727 cur .execute (query_exec , params )
2828 rows = list (cur .fetchall ())
29- log .logger .info ("Finished query" , rows = len (rows ))
29+ log .logger .debug ("Finished query" , rows = len (rows ))
3030 return rows
You can’t perform that action at this time.
0 commit comments