Accounting For "No Rows Returned" Via Python


df.size == 0
You can then add meaningful values, such as a blank string to be passed. That's what we did for this object where we built a dashboard with a chart for each major possible line item and account for it not being a part of the data returned.
# extract important variables
def extract(df):
if df.size == 0:
return ['N/A', '', '']
else:
current = str(prettify_num(df.iloc[0,1]))
contract = str(prettify_num(df.iloc[0,0]))
return [percent_difference(df), current, contract]
Updated 03-02-2023
intapiuser
Admin
Joined December 15, 2022