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

sort input validation #1517

Merged
merged 5 commits into from
Jun 7, 2016
Merged

Conversation

kwmsmith
Copy link
Member

@kwmsmith kwmsmith commented Jun 2, 2016

No description provided.

@coveralls
Copy link

coveralls commented Jun 3, 2016

Coverage Status

Coverage increased (+0.002%) to 89.248% when pulling e9d66c4 on kwmsmith:bugfix/sort-input-validation into 0cca30a on blaze:master.

@@ -100,10 +100,32 @@ def sort(child, key=None, ascending=True):
ascending : bool, optional
Determines order of the sort
"""
if ascending not in (True, False):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we not just calling bool on the object?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To guard against calls like:

t.sort('a', 'b')

When the user should have done

t.sort(['a', 'b'])

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, this is really helpful, I have tried to do that in the past. Can you just put a small comment in the source here that explains why we are doing this so I remember in the future?

@kwmsmith kwmsmith merged commit b9e8f98 into blaze:master Jun 7, 2016
@kwmsmith kwmsmith deleted the bugfix/sort-input-validation branch June 7, 2016 15:27
@coveralls
Copy link

coveralls commented Jun 7, 2016

Coverage Status

Coverage increased (+0.06%) to 89.301% when pulling 75e2488 on kwmsmith:bugfix/sort-input-validation into 0cca30a on blaze:master.

@coveralls
Copy link

coveralls commented Jun 7, 2016

Coverage Status

Coverage increased (+0.06%) to 89.301% when pulling 0f04ae8 on kwmsmith:bugfix/sort-input-validation into 0cca30a on blaze:master.

@kwmsmith kwmsmith modified the milestones: 0.11, 0.10.2 Jun 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants