Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fix(es) to Client's _make_request #1733

Merged
merged 2 commits into from
Dec 22, 2021

Conversation

kanguyen-vn
Copy link
Contributor

The current code in master has

if "poll" in includes:
            includes["polls"] = [Poll(poll) for poll in includes["polls"]]

on lines 189-190 in client.py. Because the key in the includes dictionary is actually polls instead of poll, line 190 is never executed, and thus the poll dictionaries fetched using the Twitter get request are never converted to Poll objects. This affects code consistency because all of the dictionaries in includes["tweets"], includes["users"], includes["media"], and includes["places"] get transformed into Tweet, User, Media, and Place objects respectively.

The other 2 fixes are trivial style fixes only (added line break so the line isn't too long, and removed spaces surrounding = for styling consistency).

tweepy/client.py Outdated Show resolved Hide resolved
@Harmon758 Harmon758 merged commit e3bfad5 into tweepy:master Dec 22, 2021
@Harmon758 Harmon758 added Bug This is regarding a bug with the library Improvement This is regarding an improvement to an existing feature labels Dec 22, 2021
@Harmon758
Copy link
Member

Good catches! Thanks for the PR.

@kanguyen-vn kanguyen-vn deleted the client-includes-fix branch December 22, 2021 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is regarding a bug with the library Improvement This is regarding an improvement to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants