You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This appears to be an error with the Tweet.py file
Stream encountered an exception Traceback (most recent call last): File "/home/ciptools/data-loaders/covid19-api-v2/venv/lib/python3.9/site-packages/tweepy/streaming.py", line 92, in _connect self.on_data(line) File "/home/ciptools/data-loaders/covid19-api-v2/venv/lib/python3.9/site-packages/tweepy/streaming.py", line 926, in on_data includes = self._process_includes(data["includes"]) File "/home/ciptools/data-loaders/covid19-api-v2/venv/lib/python3.9/site-packages/tweepy/client.py", line 164, in _process_includes includes["tweets"] = [Tweet(tweet) for tweet in includes["tweets"]] File "/home/ciptools/data-loaders/covid19-api-v2/venv/lib/python3.9/site-packages/tweepy/client.py", line 164, in <listcomp> includes["tweets"] = [Tweet(tweet) for tweet in includes["tweets"]] File "/home/ciptools/data-loaders/covid19-api-v2/venv/lib/python3.9/site-packages/tweepy/tweet.py", line 121, in __init__ map(int, data["edit_history_tweet_ids"]) KeyError: 'edit_history_tweet_ids'
My code
`
# This is where we set our filter rule
streamer.add_rule()
expansions = "author_id,referenced_tweets.id,in_reply_to_user_id,geo.place_id,entities.mentions.username,referenced_tweets.id.author_id",
user_fields = "created_at,description,entities,id,location,name,protected,public_metrics,url,username,verified,withheld",
tweet_fields= "attachments,author_id,context_annotations,conversation_id,created_at,entities,geo,id,in_reply_to_user_id,lang,public_metrics,possibly_sensitive,referenced_tweets,source,text,withheld",
place_fields= "contained_within,country,country_code,full_name,geo,id,name,place_type",
#return hydrated tweet
cs.filter(user_fields=user_fields, tweet_fields=tweet_fields, place_fields=place_fields, expansions=expansions)
`
The text was updated successfully, but these errors were encountered:
While adding support for the edit metadata, it did occur to me that it might be a breaking change in terms of how Tweet is initialized. I supposed there are possible use cases for wanting to use old data to construct the model. For now, I've changed it to handle the KeyError and warn about it being missing instead, with 3dea0df. This is a stopgap, but I don't really see another way to keep backwards-compatibility when the Twitter API adds new default fields to models.
This appears to be an error with the Tweet.py file
Stream encountered an exception Traceback (most recent call last): File "/home/ciptools/data-loaders/covid19-api-v2/venv/lib/python3.9/site-packages/tweepy/streaming.py", line 92, in _connect self.on_data(line) File "/home/ciptools/data-loaders/covid19-api-v2/venv/lib/python3.9/site-packages/tweepy/streaming.py", line 926, in on_data includes = self._process_includes(data["includes"]) File "/home/ciptools/data-loaders/covid19-api-v2/venv/lib/python3.9/site-packages/tweepy/client.py", line 164, in _process_includes includes["tweets"] = [Tweet(tweet) for tweet in includes["tweets"]] File "/home/ciptools/data-loaders/covid19-api-v2/venv/lib/python3.9/site-packages/tweepy/client.py", line 164, in <listcomp> includes["tweets"] = [Tweet(tweet) for tweet in includes["tweets"]] File "/home/ciptools/data-loaders/covid19-api-v2/venv/lib/python3.9/site-packages/tweepy/tweet.py", line 121, in __init__ map(int, data["edit_history_tweet_ids"]) KeyError: 'edit_history_tweet_ids'
My code
`
`
The text was updated successfully, but these errors were encountered: