EdgeIterator._total_count is not always set and can be VERY misleading
see those lines https://github.com/facebook/facebook-python-ads-sdk/blob/master/facebookads/objects.py#L146-L147. We expected it to be set every time, and we used the total() method that returns None, which is really bad because it silently tells that there is no stats. Instead:
- could we make sure we retrieve the total_count in every situation?
- if not possible, can we raise an
Exceptionso that we do not fail silently?
I can come up with a PR if you want
cc @ebzlo
@m-vdb could you submit a PR? I can get to it, but probably not until next week. I think throwing an exception when calling total() when _total_count is not set is the best solution here. Some endpoints don't return the value.
thanks, PR done, let me know if it works for you.
Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed.
@rituparnamukherjee I believe you want to merge that => https://github.com/facebook/facebook-python-ads-sdk/pull/53
@m-vdb : Can you rebase it off the latest. If not then I can get to this in a few days time.
@rituparnamukherjee actually, looks like you rebased #53 on your side and merged it => https://github.com/facebook/facebook-python-ads-sdk/blob/master/facebookads/api.py#L759-L765. You can close #53 I guess...
Sounds good ! We have done some major clean ups so might have included this one in. Thanks @m-vdb