fix: Ensure the reporting framework handles charts with no data (#23585)

This commit is contained in:
John Bodley
2023-04-06 07:30:27 +12:00
committed by GitHub
parent cd498c18ba
commit e8cfb31bff
3 changed files with 17 additions and 8 deletions

View File

@@ -111,6 +111,9 @@ def get_chart_dataframe(
pd.set_option("display.float_format", lambda x: str(x))
df = pd.DataFrame.from_dict(result["result"][0]["data"])
if df.empty:
return None
try:
# if any column type is equal to 2, need to convert data into
# datetime timestamp for that column.