Closed asmithh closed 3 years ago
I wouldn't be surprised if it turns out the source
field was inconsistent early in Twitter's operation.
I think you have the right idea for the fix. Above the tweet_insert
dictionary definition you can see I have a bunch of try/excepts for this kind of thing. Would you be able to put in a pull request that adds one for source
? So something like
try:
source = tweet['source']
except KeyError:
source = None
# so on...
tweet_insert = {
'source': source
# so on...
}
Ideally there should probably be a more robust way of handling missing fields without having to catch them all individually...
I had to fix something else, so I fixed this in 424736d046b6feec66154efeacaccfd534b6ddb2, you should be good to go now. Let me know if you run into other issues though! Thanks for catching this
thank you!!!
I'm not sure if this is because I'm looking at ancient tweets (2006 onward) or just have bad luck, but I've been getting this error:
seems to be (temporarily??) fixed by making
tweet['source'] = 'None'
if'source'
isn't intweet
before we assign everything, but that may not be ideal if we actually care about the source.anyway, I may just be cursed. lmk if this is the case!!!
https://github.com/ryanjgallagher/focalevents/blob/ef2d132c57a2d38d3d2af7e8bd7b7d4949a1056d/twitter/helper.py#L409