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

method `create_ad_video` from `AdAccount` is broken from version 3.1.3 #529

Closed julienbachmann closed 5 years ago

julienbachmann commented 5 years ago

If you call the method create_ad_video on an instance of AdAccount, you will have the following error:

line 2354, in create_ad_video
    'unpublished_content_type_enum': AdVideo.UnpublishedContentType.__dict__.values(),
AttributeError: type object 'AdVideo' has no attribute 'UnpublishedContentType'
julienbachmann commented 5 years ago

For now I workaround the problem by patching AdVideo object so that it does not crash.

# patch to fix issue https://github.com/facebook/facebook-python-business-sdk/issues/529
class EmptyClass:
    pass

AdVideo.UnpublishedContentType = EmptyClass
AdVideo.OriginalProjectionType = EmptyClass
AdVideo.Formatting = EmptyClass
AdVideo.UploadPhase = EmptyClass
AdVideo.ContentCategory = EmptyClass
AdVideo.ContainerType = EmptyClass
AdVideo.SwapMode = EmptyClass
jingping2015 commented 5 years ago

This should be fix in our recent release. Thanks for reporting this bug.