-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Query datetime parser #2528
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
Merged
Merged
Query datetime parser #2528
Changes from 19 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
61b8329
Add a date query precision of ‘hour’
discopatrick 5f2c47e
Test further hour precision intervals
discopatrick ba324df
Add a date query precision of ‘minute’
discopatrick b8e1c56
Fix tests
discopatrick 05f0072
Update docstring
discopatrick 6a71504
Allow multiple date formats for each precision
discopatrick c3771f7
Allow hour precision queries to use space separator
discopatrick 04e2975
Separate date formats onto individual lines
discopatrick c10eb8f
Keep docstring line <= 79 characters
discopatrick 02bd19f
Allow minute precision queries to use space separator
discopatrick 24890c7
Add a date query precision of ‘second’
discopatrick 1ab913b
Test each valid datetime separator
discopatrick 5a3b74f
Test an invalid datetime separator raises error
discopatrick 6e6dd76
Remove space separator tests from test_x_precision_intervals tests
discopatrick 50a2e37
Keep function names lowercase to pass flake8 tests
discopatrick 1c0b795
Refactor date-finding loop into an inner function
discopatrick fbb868e
Merge branch 'master' into query-datetime-parser
discopatrick e1101d4
Update assertion with correct error name
discopatrick 95eeec9
Add docs for datetime queries
discopatrick 291b287
Add a test for a non-range date query
discopatrick File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
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.
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 the "but before 23:00" part?
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.
I assume you're asking why there isn't a
..
in the query, followed by the right hand part of the range?This is because by specifying the hour of 22, results from anywhere within that hour are returned. The right hand part of the range is implied.
This is the same way that date queries already work.
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.
ok but the query returns items added between 23:00 and 0:00
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.
Sorry, confusion from my part with queries with the
..
at the end.Cool you added the case in the test though !
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.
No problem! It might be worth having a non-range test for all precisions?