-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
a bytes-like object is required, not 'str' #298
Comments
Has anyone been able to find a solution for this. It appears to still be an issue with the latest version. |
Still getting the same error today. |
So, apparently the 30 seconds sleep is too fast. I had a proper url return by increasing the sleep time for 300 seconds. Idk how this will impact the cloud usage yet, so I'll run a few more tests and update this thread if discover anything else. |
Is there a more reliable way to find out if a report is ready or not? The sleep method looks way too "hacky" for me. |
Idk :(
|
Just posting an update here as it seems none of the developers are actually looking at these issues. {
"id": "*****",
"status": "SUCCESS",
"url": "*****",
"created_at": "2022-08-10T10:39:25Z",
"expires_at": "2022-08-12T10:39:38Z",
"updated_at": "2022-08-10T10:39:38Z",
"start_time": "2022-06-21T04:00:00Z",
"end_time": "2022-06-22T04:00:00Z",
"entity": "CAMPAIGN",
"entity_ids": [
"*****"
],
"placement": "ALL_ON_TWITTER",
"granularity": "DAY",
"metric_groups": [
"ENGAGEMENT",
"BILLING"
]
} A simple while with some waiting time and periodic checking should be a better way to do this than waiting an arbitrary amount of time.
Thanks for this- I'll make use of it. |
hey all - thank you for the thoughtful discussion. given bandwidth constraints we haven't been able to look into this issue as soon as we'd liked and given that this seems to affect a lot of users i'd like to dedicate some time towards a fix. @pep4eto1211 I'd love to hear your thoughts on what we can be doing better in terms of code quality and feature sets that are missing. generally speaking when it comes to fetching analytics we've got a general algorithm available in our documentation page which outlines how to use the |
Hey all, I got the same issue as well. Any updates on this? |
Nothing on my side, we finished the project using the workaround mentioned before and I have no longer worked with Twitter API since then. |
Steel getting this error. |
How is this still not fixed? Soon it'll be 2 years since the first issue. |
There is a issue in analytics.py.
Traceback (most recent call last): File ".\api.py", line 60, in <module> async_data.append(LineItem.async_stats_job_data(account, url=result.url)) File "D:\Office\twitter ads\env\lib\site-packages\twitter_ads\analytics.py", line 115, in async_stats_job_data response = Request(account.client, 'get', resource.path, domain=domain, File "D:\Office\twitter ads\env\lib\site-packages\twitter_ads\http.py", line 70, in perform raise Error.from_response(response) File "D:\Office\twitter ads\env\lib\site-packages\twitter_ads\error.py", line 45, in from_response return ERRORS[response.code](response) File "D:\Office\twitter ads\env\lib\site-packages\twitter_ads\error.py", line 13, in __init__ if response.body and 'errors' in response.body: TypeError: a bytes-like object is required, not 'str'
This error is caused when running the analytics.py file. Please fix this issue.
The text was updated successfully, but these errors were encountered: