This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Refactor Filter
to handle data differently
#11194
Merged
Merged
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
c923cc8
Re-use calculated variables in filtering.
clokep 32074ad
Pre-calculate limit.
clokep 7004132
Pre-calculate lazy_load_members.
clokep 590d131
Pre-calculate include_redundant_members.
clokep efb248f
Rename an internal method.
clokep ac9413b
Change arguments to _check_fields.
clokep 69da896
Do not fetch content twice.
clokep 5c00c85
Check different fields for presence vs. events.
clokep cf0f515
Simplify _check_fields.
clokep 5f12887
Newsfragment
clokep 2bb1462
Review comments.
clokep 14a805c
Clarify use of content.
clokep File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Minor: I think we generally write this this as
event.get("content", {})
?If
event["content"]
was an empty string,False
or an empty list then we'd interpret the content as an empty dictionary. That feels like it might be unintentionally suppressing a type check?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.
This was done on purpose to handle those cases actually! If it is of the wrong type we really just want to pretend it is a dictionary.
Regardless this is mostly just moving code which could be improved. I'll add some more error checking though.
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.
Ahhh, I guess this is an event we have already persisted and so it needs to remain as it is? (As in, we can't reject it and say "this is of the wrong format"?)
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.
Oh, right they should always have content, but
event
is a misnomer -- this is sometimes account data or potentially other things.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.
I tried to make this better with 14a805c.