facebook / facebook-python-business-sdk

Python SDK for Meta Marketing APIs
https://developers.facebook.com/docs/business-sdk
Other
1.29k stars 635 forks source link

Targeting seems to be undefined in abstractobject #508

Closed kioksy closed 6 years ago

kioksy commented 6 years ago

In my requests i get the following error

adset.remote_update(batch=batch)
  File "/usr/local/lib/python2.7/site-packages/facebook_business/adobjects/abstractcrudobject.py", line 395, in remote_update
    self._set_data(params)
  File "/usr/local/lib/python2.7/site-packages/facebook_business/adobjects/abstractcrudobject.py", line 186, in _set_data
    self[key] = data[key]
  File "/usr/local/lib/python2.7/site-packages/facebook_business/adobjects/abstractcrudobject.py", line 68, in __setitem__
    if key not in self._data or self._data[key] != value:
  File "/usr/local/lib/python2.7/_abcoll.py", line 429, in __ne__
    return not (self == other)
  File "/usr/local/lib/python2.7/site-packages/facebook_business/adobjects/abstractobject.py", line 58, in __eq__
    return other is not None and hasattr(targeting, 'export_all_data') and \
NameError: global name 'targeting' is not defined
abetomo commented 6 years ago

This is a bug in the SDK. A temp fix: https://github.com/facebook/facebook-python-business-sdk/issues/504#issuecomment-411135331

jingping2015 commented 6 years ago

This should fix in our next release.