v2 Tweet, unable to unpickle using dill, max recursion reached
See original GitHub issueUsing the new v2 twitter API and version 4.5.0 of Tweepy, with version 0.3.4 of dill, the following code results in a RecursionError: maximum recursion depth exceeded
:
query = 'your search here'
import tweepy
from twitter_credentials import bearer_token
client = tweepy.Client(bearer_token=bearer_token, return_type = tweepy.Response)
search_result = client.search_recent_tweets(query = query, max_results=10)
t = search_result.data[0]
import dill
serialized = dill.dumps(t)
u = dill.loads(serialized)
The problem seems to be in __getattr__
:
File "/Users/username/opt/anaconda3/lib/python3.8/site-packages/tweepy/mixins.py", line 30, in __getattr__
return self.data[name]
[Previous line repeated 992 more times]
It sure would be dandy to be able to serialize using dill!
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Hitting Maximum Recursion Depth Using Pickle / cPickle
Trying to pickle a highly recursive data structure may exceed the maximum recursion depth, a RuntimeError will be raised in this case.
Read more >tweepy - Bountysource
Using the new v2 twitter API and version 4.5.0 of Tweepy, with version 0.3.4 of dill, the following code results in a RecursionError:...
Read more >Release Notes — Airflow Documentation
Rewrite recursion when parsing DAG into iteration (#25898) ... A sensor will immediately fail without retrying if timeout is reached.
Read more >Airflow Documentation - Read the Docs
Airflow is a platform to programmatically author, schedule and monitor workflows. Use airflow to author workflows as directed acyclic graphs ...
Read more >Node [[@karlicoss/python]] in anagora.org
[2020-05-02] zachwill/moment: Dealing with dates in Python shouldn't have to ... [2019-10-27] pylint exceed maximum recursion depth · Issue #2388 · PyCQA/ ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Harmon758 Setting
return_type=dict
when I initialize the tweepyClient
should work! I didn’t know about that option–thanks.I also got this error while trying to pickle Response objects. I ended up saving out each part of Response objects (.data, .includes, .errors) as JSON lines files, but it would have saved me time to simply be able to pickle them all.