Comments (7)
We can modify it to have a filename
or file
parameter and check to see one or the other exists. It then allows someone working on top of the SDK to be explicit about what they want to pass in.
from facebook-python-business-sdk.
Yes, that's a possible way though I would avoid using file
as parameter name.
My only concern is the def remote_create_from_zip(cls, filename, parent_id, api=None)
because I have to change that to def remote_create_from_zip(cls, filename=None, parent_id=None, api=None, fileobject=None)
to keep the current order of parameters.
from facebook-python-business-sdk.
That's a good point @tomako
Open to your thoughts on this suggestion:
The second method signature is definitely not ideal, especially for someone who wants to take advantage of the fileobject
parameter without specifying argument names. If we modify ordering we'll create a breaking change for anybody who's not specifying argument names in method calls.
How about we have filename
check for object type: string
vs object
and deal with it appropriately (I realize that's super confusing, but bear with me).
Add an additional parameter to remote_create_from_zip
named file
, which simply acts as an alias to filename
.
def remote_create_from_zip(cls, file=None, parent_id=None, api=None, filename=None):
- The method now needs to validate that
filename
orfile
came through.
We can post breaking changes in the README.md
that filename
is deprecated and file
will take its place (and that the method is now polymorphic).
In the next major patch, I will remove filename
.
from facebook-python-business-sdk.
Alright, it sounds good.
So should add a new field to AdImage and deal with it on the same way as do with filename
(string
vs. object
checking). And the zip method also would get a new field as you defined. Must validate that filename
or the new field is passed (and also the parent_id
).
The only thing we should agree the name of this new parameter. Since file
is a type name I wouldn't use it although it would be perfect. What about image_file
and zip_file
(for zip method)?
from facebook-python-business-sdk.
Hah, for all my caveats I just spotted in the standard lib that ZipFile
has a file
parameter and the description is suprisingly "file
can be either a path to a file (a string) or a file-like object". I don't fight :)
from facebook-python-business-sdk.
Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed.
from facebook-python-business-sdk.
Closing this out because AdImage is one of the autogenerated files. We will try and incroporate this change in our codegen framework
from facebook-python-business-sdk.
Related Issues (20)
- fbMarketplace.com bruterforce attack
- Fb.me bruterforce attack
- [New Pages Experience] HOT 5
- Which versions of this Business SDK package correspond to the Marketing API versions? HOT 1
- Always got "The value must be a valid insights metric" error HOT 2
- Stub files
- typechecker.py does not handle <list<map<string, string>>> correctly. HOT 1
- facebook_business.adobjects.business.Business get_ad_network_analytics() ERROR HOT 3
- Meta API does not respond to requests, hosted on Azure HOT 3
- Error : Cannot include in summary param error message HOT 7
- Inconsistent Event Reporting - Unknown error HOT 3
- Pulling from ad tables(ads, ads_insights, campaigns, adsets etc... ) getting "Cannot include video_p100_watched_actions...
- Embecodon
- Where do I get the placement and site_source_name values in the SDK? HOT 5
- Api to count the total number of objects HOT 1
- Any function to get Call to Action options?
- API/Function through which I can get the Call to Actions Options HOT 2
- Call to Ads API doesn't throw error on failure. HOT 1
- Not able to access Business User Insights for multiple users using the Instagram API.
- Permission Error with creative_sourcing_spec
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from facebook-python-business-sdk.