-
-
Notifications
You must be signed in to change notification settings - Fork 293
Fix KeyError legacy['can_media_tag'] in User class #341
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
base: main
Are you sure you want to change the base?
Conversation
Reviewer's Guide by SourceryThis pull request addresses a potential Updated class diagram for the User classclassDiagram
class User {
+verified: bool
+possibly_sensitive: bool
+can_dm: bool
+can_media_tag: bool
+want_retweets: bool
+default_profile: bool
+default_profile_image: bool
}
note for User "The can_media_tag attribute is now safely retrieved using .get() with a default value of False."
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
WalkthroughThe changes update the initialization of the Changes
Sequence Diagram(s)sequenceDiagram
participant L as Legacy Dictionary
participant U as User Constructor
U->>L: Retrieve 'can_media_tag' using .get()
alt Key exists
L-->>U: Return existing value
else Key missing
L-->>U: Return False
end
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🔇 Additional comments (1)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ruizie - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider adding a default value to other
legacy[...]
calls to avoid similar issues.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Twitter returned data where it caused a KeyError on
legacy['can_media_tag']
, I do not have the particular test user profile, it was lost.. but I did pass through the same data a second time with this fix and no error occurred ever again.Summary by Sourcery
Bug Fixes:
Summary by CodeRabbit