Skip to content

Commit

Permalink
BigQuery fix for Fuzz Strategy Selection Cron (#723)
Browse files Browse the repository at this point in the history
* Only upload to bigquery if data is present.

* Added a log message.
  • Loading branch information
mukundv-chrome authored and inferno-chromium committed Jul 23, 2019
1 parent 823fe0e commit a3818a1
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/appengine/handlers/cron/fuzz_strategy_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from google_cloud_utils import big_query
from handlers import base_handler
from libs import handler
from metrics import logs

HIGH_TEMPERATURE_PARAMETER = .75
MEDIUM_TEMPERATURE_PARAMETER = .5
Expand Down Expand Up @@ -176,9 +177,13 @@ def _store_probabilities_in_bigquery(data):
}
bigquery_data.append(big_query.Insert(row=bigquery_row, insert_id=None))

client = big_query.Client(
dataset_id='main', table_id='fuzz_strategy_experiments')
client.insert(bigquery_data)
if bigquery_data:
client = big_query.Client(
dataset_id='main', table_id='fuzz_strategy_experiments')
client.insert(bigquery_data)
else:
logs.log("No fuzz strategy distribution data was found to upload to "
"BigQuery.")


def _query_and_upload_strategy_probabilities():
Expand Down

0 comments on commit a3818a1

Please sign in to comment.