Skip to content

Commit

Permalink
scrub_null_sources
Browse files Browse the repository at this point in the history
  • Loading branch information
abdollahis2 authored and abdollahis2 committed Dec 11, 2023
1 parent 9389b13 commit 7e90537
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tr_sys/tr_ars/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,7 @@ def post_process(data,key, agent_name):

@shared_task(name="merge_and_post_process")
def merge_and_post_process(parent_pk,message_to_merge, agent_name):

logging.info(f"Starting merge for %s with parent PK: %s"% (agent_name,parent_pk))
try:
with transaction.atomic():
Expand Down Expand Up @@ -672,6 +673,10 @@ def scrub_null_attributes(data):
while None in edgeAttributes:
edgeAttributes.remove(None)

edgeSources=get_safe(edgeStuff, "sources")
for edge_source in edgeSources:
if edge_source["resource_id"] is None or edge_source["upstream_resource_ids"] is None:
edgeSources.remove(edge_source)


def appraise(mesg,data, agent_name,retry_counter=0):
Expand Down

0 comments on commit 7e90537

Please sign in to comment.