facebook / facebook-python-business-sdk

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

Relaxing requirement of a strict float-type to less restrictive float-castable #580

Closed wojked closed 3 years ago

wojked commented 3 years ago

There is a mismatch in behaviour in generating JSON from JS objects and Python dictionaries.

In Javascript

JSON.parse(JSON.stringify({val: 100.0}))
out> {val: 100}

In Python:

json.loads(json.dumps({"val": 100.0}))                                                                         
out> {'val': 100.0}

This leads to problems when validating CustomData(), it seems like it should accept integers and cast them to floats if FB API really needs it.

facebook-github-bot commented 3 years ago

Hi @wojked!

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 3 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!

facebook-github-bot commented 3 years ago

This pull request has been merged in facebook/facebook-python-business-sdk@b8753c0532307893b196a68126fe10ad69361457.