Skip to content

Comments

Payload v2 singletweet#83

Open
pournaki wants to merge 3 commits intomasterfrom
payload-v2-singletweet
Open

Payload v2 singletweet#83
pournaki wants to merge 3 commits intomasterfrom
payload-v2-singletweet

Conversation

@pournaki
Copy link

When the Twitter v2 payload contains a single tweet, the data entry is a single dict instead of a list.

This branch handles such cases by modifying two functions:

  • twitwi/utils.py/validate_payload_v2(): extend the possible types of payload['data'] from dict to (list,dict).
  • twitwi/normalizers.py/normalize_tweets_payload_v2(): create a list with the tweet as a single entry such to keep the logic of the function the same.

An example is in test/resources/payload-v2-singletweet.json and the resource was added to test/normalizers_test.py, but I am not sure how to proceed such that the test runs through.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant