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.
Leonlu2/inequality issue time value #1124
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
base: dev
Are you sure you want to change the base?
Leonlu2/inequality issue time value #1124
Changes from all commits
7536ca3
51cb58e
3a9c7e7
81762b8
0c1d876
896e409
cab9514
8df74aa
d2663e2
f66b2e3
22b4de7
6f4feab
3e30693
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.
nit: using a length-1 tuple here feels weird
later on we're using the tuple type information to engage the inequalities logic instead of the range logic, so it's clearly needed, but it feels unsatisfying regardless
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.
hey @rzats do you have any ideas for how we can more clearly indicate that a date parameter value is an inequality? the return value from this function is read in the date span processing at _query.py:45, dates.py:125, and dates.py:147, where inequalities need to be handled differently from other kinds of spans.
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.
Yep, I can see what this PR is going for and there might be a better way to handle the inequalities. Right now this is returning a single-element tuple to fit within the following type structure;
A clean solution would be to add a new type alias called
IntStrRange
which is a union ofTuple[int, int]
,int
and a third type - eitherstr
if we just want to know what the inequality operator is orTuple[str, int]
if we want the date too.TimeValues
can then be replaced with aSequence[IntStrRange]
, and we can then refactor the date span processing functions whereTimeValues
was previously used.