@@ -33,12 +33,19 @@ def handle(self, *args, **options):
3333 )
3434
3535 client = bigquery .Client (** params )
36+
37+ # For importing, we ignore reports that have no URL or no comment. In
38+ # theory, a NULL URL shouldn't even be possible, but we have a few
39+ # reports like that. Reports without a comment are very unlikely to be
40+ # actionable.
3641 result = client .query_and_wait (
3742 f"""SELECT r.*, t.language_code, t.translated_text
3843 FROM `{ settings .BIGQUERY_TABLE } ` as r
3944 LEFT JOIN `{ settings .BIGQUERY_TRANSLATIONS_TABLE } ` t
4045 ON r.uuid = t.report_uuid
41- WHERE r.reported_at >= @since;""" ,
46+ WHERE r.url IS NOT NULL
47+ AND r.comments IS NOT NULL
48+ AND r.reported_at >= @since;""" ,
4249 job_config = bigquery .QueryJobConfig (
4350 query_parameters = [
4451 bigquery .ScalarQueryParameter ("since" , "DATETIME" , options ["since" ])
@@ -47,8 +54,6 @@ def handle(self, *args, **options):
4754 )
4855
4956 for row in result :
50- if row .comments is None :
51- continue
5257 report_obj = Report (
5358 app_name = row .app_name ,
5459 app_channel = row .app_channel ,
0 commit comments