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

Fix for crash when sorting by nonexistent field (#1734) #1736

Merged
merged 3 commits into from
Nov 25, 2015

Conversation

diego-plan9
Copy link
Member

Fix for #1734 as suggested on the discussion (by simply replacing the line on dbcore.query.sort()). Also added a handful of test for making sure it works as expected.

for r1, r2 in zip(all_results, results):
self.assertEqual(r1.id, r2.id)

def test_field_present_in_some_items(self):
Copy link
Member Author

Choose a reason for hiding this comment

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

A small remark for this test case: when the field is only present on some items and sorting by that field on ascending order, the items that do not have that field are displayed at the top of the list. While it does make sense, I'm wondering if it might be a bit confusing for end users: perhaps a small clarification or note on the Queries - Sort order docs might be in order?

Copy link
Member

Choose a reason for hiding this comment

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

Great idea! A note in the docs would be awesome.

@sampsyo
Copy link
Member

sampsyo commented Nov 25, 2015

Fantastic! Thank you for being so thorough with the tests. ✨ This is clearly something we would have caught earlier with a more complete test suite for sorting.

sampsyo added a commit that referenced this pull request Nov 25, 2015
Fix for crash when sorting by nonexistent field (#1734)
@sampsyo sampsyo merged commit 155727a into beetbox:master Nov 25, 2015
sampsyo added a commit that referenced this pull request Nov 26, 2015
Documentation update: followup to #1736, fix typo on inline.rst
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants