facebook / facebook-python-business-sdk

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

corrected uppercase DatePreset to lowercase for AdSet #553

Closed zachliu closed 1 year ago

zachliu commented 4 years ago

The DatePreset values are lower cases. Simple fix.

facebook-github-bot commented 4 years ago

Hi zachliu! 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!

facebook-github-bot commented 4 years ago

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

zachliu commented 4 years ago

Because of these uppercase values, we should expect a very misleading warning message

facebook_business/utils/api_utils.py:30: UserWarning: value of date_preset might not be compatible.  Expect date_preset_enum;  got <class 'str'>
  warnings.warn(message)

if we do something like

campaign.get_ad_sets(params={'date_preset': 'last_30d'})

because last_30d doesn't match with LAST_30D :crying_cat_face:

And if you are using the STRICT_MODE, your code would fail with the same confusing message.