Commit 3faf2a5e authored by Sadrul Habib Chowdhury's avatar Sadrul Habib Chowdhury Committed by Commit Bot

soundwave: Gracefully handle empty timeseries response.

BUG=986679

Change-Id: I60a17ce118f64291d9bc263ad587c87a651b075a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1764560Reviewed-by: default avatarJuan Antonio Navarro Pérez <perezju@chromium.org>
Commit-Queue: Sadrul Chowdhury <sadrul@chromium.org>
Cr-Commit-Position: refs/heads/master@{#690797}
parent 26a7e2c5
...@@ -129,6 +129,10 @@ def _DataFrameFromJsonV2(ts_key, data): ...@@ -129,6 +129,10 @@ def _DataFrameFromJsonV2(ts_key, data):
def _DataFrameFromJsonV1(test_path, data): def _DataFrameFromJsonV1(test_path, data):
# The dashboard API returns an empty list if there is no recent data for the
# timeseries.
if not data:
return DataFrame()
assert test_path == data['test_path'] assert test_path == data['test_path']
config = _ParseConfigFromTestPath(data['test_path']) config = _ParseConfigFromTestPath(data['test_path'])
config['improvement_direction'] = _CODE_TO_IMPROVEMENT_DIRECTION.get( config['improvement_direction'] = _CODE_TO_IMPROVEMENT_DIRECTION.get(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment