Closed SlavaSkvortsov closed 3 years ago
Hi @SlavaSkvortsov!
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file.
In order for us to review and merge your code, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.
If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!
omg thank you @SlavaSkvortsov...
Can we get this merged and released plz?
class Cursor(object):
def load_next_page(self):
"""Queries server for more nodes and loads them into the internal queue.
Returns:
True if successful, else False.
"""
if self._finished_iteration:
return False
if (
self._include_summary and
'default_summary' not in self.params and
'summary' not in self.params
):
self.params['summary'] = True # <==============================================(! 1)
response_obj = self._api.call(
'GET',
self._path,
params=self.params,
)
response = response_obj.json()
self._headers = response_obj.headers()
if 'paging' in response and 'next' in response['paging']:
self._path = response['paging']['next']
self.params = [] # <==============================================(! 2)
else:
# Indicate if this was the last page
self._finished_iteration = True
quick fix outside of library
def get_ad_accounts(self):
fb_user = fb.User('me', api=self._api)
_request = fb_user.get_ad_accounts(
fields=[
fb.AdAccount.Field.id,
fb.AdAccount.Field.account_id,
fb.AdAccount.Field.name,
fb.AdAccount.Field.account_status,
fb.AdAccount.Field.currency,
fb.AdAccount.Field.timezone_id,
],
pending=True
)
#
response = _request.execute()
# ------------------------------------------------------------ #
result = []
for item in response:
# fixme: remove after facebook will fix it
# from facebook_business.api import Cursor
# - - -
if isinstance(response.params, list):
assert len(response.params) == 0
response.params = {} # <=====================================(*)
#
# - - -
assert isinstance(item, fb.AdAccount)
attrs = item.export_all_data()
The quick fix is to use 7.0.3 :)
Pagination is still not fixed, is there a reason why this can't be merged, it looks like an obvious bug?
pls merge :)
can you please merge this change?
Could you please merge this ASAP, wondering how 8.0 was published with broken pagination.
can you please merge this change?
Could this be merged please?
can this be merged in? any idea what's causing the delay?
This should be closed, the fix is already in master: https://github.com/facebook/facebook-python-business-sdk/commit/422d88aeb8e057b92820b430c1006964c1ae887f
If you look at the file diff on this PR there are no changes left, after SlavaSkvortsov rebased it to master a couple days ago there is nothing left to merge.
This should be closed, the fix is already in master: 422d88a
If you look at the file diff on this PR there are no changes left, after SlavaSkvortsov rebased it to master a couple days ago there is nothing left to merge.
Good. But it is a critical bug and fix is not yet released as a new version for pip.
Since v8.0.2, this bug should be fixed.
It should be a dict -_- Could you use Mypy or test or, better, both?