This repository has been archived by the owner on Nov 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Returning an empty list instead of None when post-processors filter a… #309
Merged
eastandwestwind
merged 3 commits into
main
from
308-post-processors-returning-none-will-cause-the-retrieve_data-function-to-retry-until-failure
Mar 22, 2022
Merged
Returning an empty list instead of None when post-processors filter a… #309
eastandwestwind
merged 3 commits into
main
from
308-post-processors-returning-none-will-cause-the-retrieve_data-function-to-retry-until-failure
Mar 22, 2022
Conversation
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
…ll data or unwrap to an empty value
galvana
commented
Mar 21, 2022
# flatten the list to account for the event where the output of unwrapped | ||
# is a list of lists | ||
unwrapped = pydash.flatten(unwrapped) | ||
|
||
if unwrapped is None: |
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.
Moved this inside for loop to log a warning for each occurrence.
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.
thanks for restructuring, much more explicit per occurrence 💯
galvana
commented
Mar 21, 2022
def process(self, data: Any, identity_data: Dict[str, Any] = None) -> Any: | ||
def process( | ||
self, data: Any, identity_data: Dict[str, Any] = None | ||
) -> Union[List[Dict[str, Any]], Dict[str, Any]]: |
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.
Being more specific with return type since we know now to expect a dict or a list.
eastandwestwind
approved these changes
Mar 22, 2022
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.
lgtm, nice work!
eastandwestwind
deleted the
308-post-processors-returning-none-will-cause-the-retrieve_data-function-to-retry-until-failure
branch
March 22, 2022 16:36
sanders41
pushed a commit
that referenced
this pull request
Sep 22, 2022
#309) * Returning an empty list instead of None when post-processors filter all data or unwrap to an empty value * Re-adding code missed during cleanup * Fixing formatting Co-authored-by: Adrian Galvan <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Purpose
To fix the issue described in #308.
Changes
Modified the filter and unwrap post-processors to return an empty list
[]
for the following scenarios:Filter
Unwrap
data_path
Checklist
Run Unsafe PR Checks
label has been applied, and checks have passed, if this PR touches any external servicesTicket
Fixes #308