facebook-python-business-sdk icon indicating copy to clipboard operation
facebook-python-business-sdk copied to clipboard

corrected uppercase DatePreset to lowercase for AdSet

Open zachliu opened this issue 6 years ago • 3 comments
trafficstars

The DatePreset values are lower cases. Simple fix.

zachliu avatar Nov 13 '19 04:11 zachliu

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 [email protected]. Thanks!

facebook-github-bot avatar Nov 13 '19 04:11 facebook-github-bot

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

facebook-github-bot avatar Nov 13 '19 17:11 facebook-github-bot

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.

zachliu avatar Nov 13 '19 21:11 zachliu