- an empty string is not the same as None, that's correct. So both need to be
checked
- yes, first I check on false (missing keys, etc.) then true (positive outcome)
return list()
elif "json" not in fetched:
raise KeyError("fetched has no element 'json'")
- elif rows_key != "" and rows_key not in fetched["json"]:
- raise KeyError("fetched[row] has no element '{rows_key}'")
+ elif rows_key not in[None, ""] and rows_key not in fetched["json"]:
+ raise KeyError(f"fetched[row] has no element '{rows_key}'")
elif rows_key == None:
logger.debug("Parameter 'rows_key' is not set, using whole fetched['json'] as rows ...")
rows = fetched["json"]