File tree Expand file tree Collapse file tree
middleware/sql_to_arc/src/middleware/sql_to_arc Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -563,5 +563,3 @@ async def main() -> None:
563563if __name__ == "__main__" :
564564 multiprocessing .freeze_support ()
565565 asyncio .run (main ())
566- # test unstaged
567- # commit test
Original file line number Diff line number Diff line change 11"""Mapper module to convert database rows to ARCTRL objects."""
22
33import json
4+ import logging
45from datetime import datetime
56from typing import Any , cast
67
1314 Publication ,
1415)
1516
17+ logger = logging .getLogger (__name__ )
18+
1619
1720def map_investigation (row : dict [str , Any ]) -> ArcInvestigation :
1821 """Map a database row to an ArcInvestigation object.
@@ -107,8 +110,13 @@ def map_contact(row: dict[str, Any]) -> Person:
107110 tan = r .get ("uri" ),
108111 )
109112 )
110- except (json .JSONDecodeError , TypeError ):
111- # Fallback for invalid JSON or type mismatch
113+ except (json .JSONDecodeError , TypeError ) as e :
114+ # Fallback for invalid JSON or type mismatch, with logging
115+ logger .warning (
116+ "Could not parse roles JSON for contact with email '%s'. Error: %s" ,
117+ row .get ("email" , "N/A" ),
118+ e ,
119+ )
112120 pass
113121
114122 return Person .create (
You can’t perform that action at this time.
0 commit comments