Skip to content

Commit

Permalink
Use empty string instead of 0 for missing metrics in mapped Twitter data
Browse files Browse the repository at this point in the history
  • Loading branch information
stijn-uva committed Feb 8, 2024
1 parent 38a865e commit e329b2e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion datasources/twitterv2/search_twitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ def map_item(tweet):
if variants:
videos.append(variants[0].get('url'))

public_metrics = {k: tweet["public_metrics"].get(k, 0) for k in ("impression_count", "retweet_count", "bookmark_count", "like_count", "quote_count", "reply_count")}
public_metrics = {k: tweet["public_metrics"].get(k, "") for k in ("impression_count", "retweet_count", "bookmark_count", "like_count", "quote_count", "reply_count")}

return {
"id": tweet["id"],
Expand Down

0 comments on commit e329b2e

Please sign in to comment.