Exception in flowservice.getRuns if there are no runs
cmenguy opened this issue · comments
If there is no runs returned in getRuns
then it will fail because the _links
won't be set in the response:
File /usr/local/lib/python3.10/site-packages/aepp/flowservice.py:756, in FlowService.getRuns(self, limit, n_results, prop, **kwargs)
754 res: dict = self.connector.getData(self.endpoint + path, params=params)
755 items: list = res["items"]
--> 756 nextPage = res["_links"].get("next", {}).get("href", "")
757 while nextPage != "" and len(items) < float(n_results):
758 token: str = res["_links"]["next"].get("href", "")
KeyError: '_links'
It should just return an empty array.
I'll take care of it. Thanks for notifying
Changed the code to returns an empty list when there are no items.
Fix with 0.2.9