Skip to content

Commit

Permalink
Merge pull request #5 from jackjyzhang/patch-1
Browse files Browse the repository at this point in the history
Fix invalid tweet bug
  • Loading branch information
AADeLucia authored Mar 1, 2022
2 parents 3bbf2a3 + 93ba501 commit 84227e9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions littlebird/tweet_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ def read_tweets(self,
try:
with jl.Reader(self.f) as reader:
for tweet in reader.iter(skip_empty=True, skip_invalid=True):
# Skip invalid tweets
if not isinstance(tweet, dict):
continue
count_total += 1
# Skip tweets that are marked as retweets
if skip_retweeted_and_quoted:
Expand Down

0 comments on commit 84227e9

Please sign in to comment.