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.
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
Returning success count from the
.populate()
call #1050Returning success count from the
.populate()
call #1050Changes from 19 commits
29357fe
b737003
d1011fb
6f7a0c0
1f358a9
eb827e6
1b4806e
0abd3c0
6bf2afc
37801d6
7a258d4
9480435
0f84560
02127a0
c061f8a
9ef2046
c66ff04
ff6b81c
45938aa
e143ce8
291a468
008a723
18fd619
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
is
processes == 0
handled? PerhapsThere 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.
It is handled in the
else
blockThere 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.
If we change
_populate
to returnTrue
,False
, or(key, error)
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.
Not sure about this
True
. The docstring needs an update to explain. It's a bit odd to have so many different return types.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.
What about returning
True/False
for success/failure instead of None (ifsuppress_errors=False
)?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.
When does it ever return
False
?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.
Then you should add
return False
to the case when the function returns without populating anything.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.
Does not populating anything constitute a
False
?False
seems to indicate failure (maybe that's just me thinking so).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.
The current function produces
True
if successful,None
if nothing is populated, throws an exception, or returns(key, error)
. It never returnsFalse
. It seems that if a function returnsTrue
, it should also returnFalse
in other cases. Perhaps instead ofNone
, we should returnFalse
. It would not indicate an error, but simply not populating for other reasons than an error.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.
Agreed, I'll update accordingly