"message": "(#100) Param publisher_urls_file must be a file with one of the following types: text/csv, text/plain, application/vnd.ms-excel. Received file of type ''.",
response = fb_business.create_block_list_draft(params=params)
File "/home/etl-pm-pipeline-facebook/venv/lib/python3.6/site-packages/facebook_business/adobjects/business.py", line 802, in create_block_list_draft
request.add_params(params)
File "/home/etl-pm-pipeline-facebook/venv/lib/python3.6/site-packages/facebook_business/api.py", line 656, in add_params
self.add_param(key, params[key])
File "/home/etl-pm-pipeline-facebook/venv/lib/python3.6/site-packages/facebook_business/api.py", line 642, in add_param
if not self._param_checker.is_valid_pair(key, value):
File "/home/etl-pm-pipeline-facebook/venv/lib/python3.6/site-packages/facebook_business/typechecker.py", line 81, in is_valid_pair
return self.is_type(value_type, value)
File "/home/etl-pm-pipeline-facebook/venv/lib/python3.6/site-packages/facebook_business/typechecker.py", line 92, in is_type
...
TypeError: stat: path should be string, bytes, os.PathLike or integer, not tuple
and received this error
compatible. Expect file; got <class 'bytes'>
warnings.warn(message)
Traceback (most recent call last):
File "/home/etl-pm-pipeline-facebook/services/brandsafety/upload_blocklists/upload_blocklists-2.py", line 44, in
main()
File "/home/etl-pm-pipeline-facebook/services/brandsafety/upload_blocklists/upload_blocklists-2.py", line 37, in main
response = fb_business.create_block_list_draft(params=params)
File "/home/etl-pm-pipeline-facebook/venv/lib/python3.6/site-packages/facebook_business/adobjects/business.py", line 812, in create_block_list_draft
return request.execute()
File "/home/etl-pm-pipeline-facebook/venv/lib/python3.6/site-packages/facebook_business/api.py", line 681, in execute
with open_files(self._file_params) as files:
File "/usr/local/Cellar/python@3.6/3.6.15/Frameworks/Python.framework/Versions/3.6/lib/python3.6/contextlib.py", line 81, in enter
return next(self.gen)
File "/home/etl-pm-pipeline-facebook/venv/lib/python3.6/site-packages/facebook_business/api.py", line 882, in open_files
opened_files.update({key: open(path, 'rb')})
OSError: [Errno 63] File name too long: b'...
I receive either an API Error when using the library for create_block_list_draft or an error in the code when trying to specify the file type
I receive the following error
"message": "(#100) Param publisher_urls_file must be a file with one of the following types: text/csv, text/plain, application/vnd.ms-excel. Received file of type ''.",
So I tried a variation of that with
And received an error in the library
response = fb_business.create_block_list_draft(params=params) File "/home/etl-pm-pipeline-facebook/venv/lib/python3.6/site-packages/facebook_business/adobjects/business.py", line 802, in create_block_list_draft request.add_params(params) File "/home/etl-pm-pipeline-facebook/venv/lib/python3.6/site-packages/facebook_business/api.py", line 656, in add_params self.add_param(key, params[key]) File "/home/etl-pm-pipeline-facebook/venv/lib/python3.6/site-packages/facebook_business/api.py", line 642, in add_param if not self._param_checker.is_valid_pair(key, value): File "/home/etl-pm-pipeline-facebook/venv/lib/python3.6/site-packages/facebook_business/typechecker.py", line 81, in is_valid_pair return self.is_type(value_type, value) File "/home/etl-pm-pipeline-facebook/venv/lib/python3.6/site-packages/facebook_business/typechecker.py", line 92, in is_type ... TypeError: stat: path should be string, bytes, os.PathLike or integer, not tuple
I also tried
and received this error compatible. Expect file; got <class 'bytes'> warnings.warn(message) Traceback (most recent call last): File "/home/etl-pm-pipeline-facebook/services/brandsafety/upload_blocklists/upload_blocklists-2.py", line 44, in
main()
File "/home/etl-pm-pipeline-facebook/services/brandsafety/upload_blocklists/upload_blocklists-2.py", line 37, in main
response = fb_business.create_block_list_draft(params=params)
File "/home/etl-pm-pipeline-facebook/venv/lib/python3.6/site-packages/facebook_business/adobjects/business.py", line 812, in create_block_list_draft
return request.execute()
File "/home/etl-pm-pipeline-facebook/venv/lib/python3.6/site-packages/facebook_business/api.py", line 681, in execute
with open_files(self._file_params) as files:
File "/usr/local/Cellar/python@3.6/3.6.15/Frameworks/Python.framework/Versions/3.6/lib/python3.6/contextlib.py", line 81, in enter
return next(self.gen)
File "/home/etl-pm-pipeline-facebook/venv/lib/python3.6/site-packages/facebook_business/api.py", line 882, in open_files
opened_files.update({key: open(path, 'rb')})
OSError: [Errno 63] File name too long: b'...