Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Sort and limit #24

Merged
merged 44 commits into from

5 participants

@robyoung
Owner

Add the ability to sort and limit queries in the read API. This includes a rewrite of how grouping is done so that the sorting and limiting could be shared. It also changes the output format to match the wiki as per discussions during the course of the story.

@robyoung
Owner

I don't think this is right, it doesn't match the wiki documentation or the usage in limelight.

Feel free to change, with the proviso that if we have logic around the ordering of a result we should be testing that logic. What is the expected result?

robyoung and others added some commits
@robyoung robyoung Add stop flag to behave
Behave doesn't stop and returns a zero exit status on failures. This is
not ideal. Passing the stop flag forces it to stop and exit with a
status of one.
ec14502
@robyoung robyoung Change default sort order to ascending
After discussing with @abersager ascending chronological order is a more
convenient default.
0ff705a
@robyoung robyoung Refactor database integration tests
Slightly refactor to remove duplication in fixture setup.
fa2a3ae
@robyoung robyoung Add test for sorting by non-existent key ecbff5f
@robyoung robyoung pep8 6f66ce1
@robyoung robyoung Tee pep8 output so that it's visible in CI console 7baf6f7
@robyoung robyoung Rename sort parameter to sort_by
It was sort_on in the feature test, sort in the code and sort_by in the
wiki. The wiki rules!

@pbadenski
@robyoung
67589e8
@robyoung robyoung Add basic query sorting to Bucket 0c09d22
@robyoung robyoung Fix query sort feature test
- Explicitly expect an integer, by default the numbers are parsed as
  strings
- Extract nth result position parsing in step definitions
- Add 'first' and 'last' options for result position parsing.

@pbadenski
@robyoung
22970d0
@robyoung robyoung PEP8! 3dbc35d
@robyoung robyoung Add limit to read API
- Allow the user to limit the number of results returned

@robyoung
@pbadenski
933f5da
@robyoung robyoung Add test to verify sort and limit together 86816c8
@maxfliri maxfliri Conform response for grouping query to api design c6716ac
@robyoung robyoung Add sort by to grouped query e684ed7
@robyoung robyoung Add limit to grouped query ecc6c42
@robyoung robyoung Switch order of nesting in periodic grouped query 4f02732
@robyoung robyoung Extract and simplify group integration tests
They were getting a bit disjointed and hard to follow. This pulls them
out into their own class with a common fixture used across all the
tests.
ea1735f
@robyoung robyoung Refactor grouping and repo response format
This makes both grouping functions in database.Repository use the same
code. It also changes the output to be nested lists and therefore allow
sorting.
d75ac15
@robyoung robyoung Add sorting to multi group query 85bb567
@robyoung robyoung Add limit to multi group query f793e25
@robyoung robyoung Add limit to period query 26932d4
@robyoung robyoung Don't allow sorting of periodic queries a53c464
@robyoung robyoung More descriptive error messages 9a754d6
@robyoung robyoung Merge branch 'master' into sort_and_limit
Conflicts:
	backdrop/core/bucket.py
	tests/core/test_bucket.py
8b68cf0
@robyoung robyoung Refactor nested merge function
An attempt to make it a bit clearer what's happening.
f5f316a
@robyoung robyoung Minor, largely cosmetic improvements
Rename some variables to be more clear about their purpose
Make some conditions simpler
Remove some whitespace

@pbadenski
@robyoung
c513fb5
@pbadenski pbadenski merged commit 694427e into master

1 check passed

Details default Build #103 succeeded on Jenkins
@pbadenski pbadenski deleted the sort_and_limit branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 22, 2013
  1. @norm
Commits on Mar 26, 2013
  1. @gtrogers
  2. @gtrogers

    Remove empty test file

    gtrogers authored
  3. @gtrogers

    Rename test

    gtrogers authored
  4. @gtrogers

    Allow optional trailing slash

    Pawel Badenski authored gtrogers committed
  5. @gtrogers
  6. @gtrogers
  7. @gtrogers

    Merge branch 'master' into sort_and_limit

    gtrogers authored
    Conflicts:
    	backdrop/read/validation.py
  8. @gtrogers

    Pep8 compliance

    gtrogers authored
  9. @gtrogers

    Revert "Allow optional trailing slash"

    gtrogers authored
    This reverts commit 234e542.
  10. @gtrogers
  11. @gtrogers

    Remove trailing slash from test

    gtrogers authored
    It is no longer required
    
    @gtrogers
    @robyoung
  12. @gtrogers
  13. @gtrogers
  14. @gtrogers

    pep8

    gtrogers authored
  15. @gtrogers
  16. @gtrogers
Commits on Mar 27, 2013
  1. @robyoung

    Ignore scenarios tagged with wip

    robyoung authored
    If a scenario is tagged with @wip then it will not be run in CI. This is
    useful when writing the feature tests before the code.
  2. @robyoung

    Add stop flag to behave

    robyoung authored
    Behave doesn't stop and returns a zero exit status on failures. This is
    not ideal. Passing the stop flag forces it to stop and exit with a
    status of one.
  3. @robyoung

    Change default sort order to ascending

    robyoung authored
    After discussing with @abersager ascending chronological order is a more
    convenient default.
  4. @robyoung

    Refactor database integration tests

    robyoung authored
    Slightly refactor to remove duplication in fixture setup.
  5. @robyoung
  6. @robyoung

    pep8

    robyoung authored
  7. @robyoung
  8. @robyoung

    Rename sort parameter to sort_by

    robyoung authored
    It was sort_on in the feature test, sort in the code and sort_by in the
    wiki. The wiki rules!
    
    @pbadenski
    @robyoung
  9. @robyoung
  10. @robyoung

    Fix query sort feature test

    robyoung authored
    - Explicitly expect an integer, by default the numbers are parsed as
      strings
    - Extract nth result position parsing in step definitions
    - Add 'first' and 'last' options for result position parsing.
    
    @pbadenski
    @robyoung
  11. @robyoung

    PEP8!

    robyoung authored
  12. @robyoung

    Add limit to read API

    robyoung authored
    - Allow the user to limit the number of results returned
    
    @robyoung
    @pbadenski
  13. @robyoung
Commits on Mar 28, 2013
  1. @maxfliri @robyoung
  2. @robyoung
  3. @robyoung
  4. @robyoung
  5. @robyoung

    Extract and simplify group integration tests

    robyoung authored
    They were getting a bit disjointed and hard to follow. This pulls them
    out into their own class with a common fixture used across all the
    tests.
  6. @robyoung

    Refactor grouping and repo response format

    robyoung authored
    This makes both grouping functions in database.Repository use the same
    code. It also changes the output to be nested lists and therefore allow
    sorting.
  7. @robyoung
  8. @robyoung
  9. @robyoung
  10. @robyoung
  11. @robyoung
  12. @robyoung

    Merge branch 'master' into sort_and_limit

    robyoung authored
    Conflicts:
    	backdrop/core/bucket.py
    	tests/core/test_bucket.py
  13. @robyoung

    Refactor nested merge function

    robyoung authored
    An attempt to make it a bit clearer what's happening.
  14. @robyoung

    Minor, largely cosmetic improvements

    robyoung authored
    Rename some variables to be more clear about their purpose
    Make some conditions simpler
    Remove some whitespace
    
    @pbadenski
    @robyoung
Something went wrong with that request. Please try again.