Skip to content

Commit

Permalink
Fixes to seqr sync (#772)
Browse files Browse the repository at this point in the history
* Fixes to seqr sync

* Add backoff to server requirements
  • Loading branch information
EddieLF authored May 14, 2024
1 parent f1b9811 commit 46a5cf5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
9 changes: 5 additions & 4 deletions db/python/layers/participant.py
Original file line number Diff line number Diff line change
Expand Up @@ -765,13 +765,14 @@ async def get_seqr_individual_template(
set_headers.update(set(row.keys()))

rows = [{h: r.get(h) for h in set_headers if h in r} for r in rows]
headers = [] # get ordered headers if we have data for it
for h in SeqrMetadataKeys.get_ordered_headers():
if header := lheader_to_json.get(h.value.lower()) in set_headers:
headers.append(header)

return {
'rows': rows,
# get ordered headers if we have data for it
'headers': [
h for h in SeqrMetadataKeys.get_ordered_headers() if h in set_headers
],
'headers': headers,
'header_map': json_header_map,
}

Expand Down
2 changes: 2 additions & 0 deletions db/python/layers/seqr.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import aiohttp
import slack_sdk
import slack_sdk.errors
from backoff import expo, on_exception
from cloudpathlib import AnyPath

from cpg_utils.cloud import get_google_identity_token
Expand Down Expand Up @@ -498,6 +499,7 @@ async def update_es_index(
messages.extend(await asyncio.gather(*requests))
return messages

@on_exception(expo, aiohttp.ClientResponseError, max_tries=3)
async def update_saved_variants(
self,
session: aiohttp.ClientSession,
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# requirements are for running the server
# fix boto3/core version to prevent pip downloading all the versions caused by cloudpathlib
backoff>=2.2.1
boto3==1.28.56
botocore==1.31.56
cpg-utils>=5.0.5
Expand Down

0 comments on commit 46a5cf5

Please sign in to comment.