pitchmuc / aepp

Adobe Experience Platform API for humans

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

commented

I'll take care of it. Thanks for notifying

commented

Changed the code to returns an empty list when there are no items.

commented

Fix with 0.2.9