File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed 
datapackage_pipelines_budgetkey/pipelines/budgetkey/emails Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -55,14 +55,18 @@ def process_row(row, *_):
5555                      term = props ['term' ],
5656                      query_url = query_url (props ['term' ], filters )
5757                  ))
58-         sections .append (section )
59-     ret  =  dict (
60-         sections = sections ,
61-         email = row ['email' ]
62-     )
63-     logging .info ('DATAS: %r' , ret )
64-     result  =  requests .post ('http://budgetkey-emails:8000/' , json = ret ).json ()
65-     logging .info ('RESULT: %r' , result )
58+         if  len (terms ) >  0 :
59+             sections .append (section )
60+     if  len (sections ) >  0 :
61+         ret  =  dict (
62+             sections = sections ,
63+             email = row ['email' ]
64+         )
65+         logging .info ('DATAS: %r' , ret )
66+         result  =  requests .post ('http://budgetkey-emails:8000/' , json = ret ).json ()
67+         logging .info ('RESULT: %r' , result )
68+     else :
69+         logging .info ('SKIPPING %s as has no relevant subscriptions' , row ['email' ])
6670
6771
6872if  __name__  ==  '__main__' :
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments