-
Notifications
You must be signed in to change notification settings - Fork 67
API server code improvements surrounding some "time" processing routines #999
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
Comments
fwiw, if we bump to Python 3.10, we could turn |
wrt the last point: if someone requests multiple data sources in a single request, that will translate to a |
agree with the rest (especially the confusing "pair" name)! very happy to see movement in this direction. |
@rzats @melange396 A few ideas:
|
Yes! This is in the last bullet of the initial issue comment. Lets get rid of these -- searching with
The real work in
I completely agree. |
@dshemetov @melange396 I've done some more work on datetime refactoring, so the only remaining bullet point is around merging
What do you think? |
Mixed date types will cause problems at the client side, so we should reject those queries. Mixed star and value types should coalesce to star if we can. |
@rzats those tests you linked to make me think of this image that was shared with me recently XD |
Persuant to #998, theres a lot of needlessly complicated stuff in the api server code...
This is a section of this, focused mostly around time-related objects and routines
TimePair
is a bit of a misnomer in that the second object of the "pair" is a date type (either 'day' or 'week'), and the other component is a possibly mixed list of pairs of dates (ranges) or individual dates. "dates" and "TimePair" objects should probably be refactored/combined into one to reduce confusion.guess_time_value_is_*
is a potentially dangerous cruch and should only be used if time type was not specified in the requestwhere_dates
in server code -- linting can probably help us locate thesetime_value_to_date
<==>date_to_time_value
, butweek_to_time_value
<==> ***week_value_to_week
***Sequence[Union[Tuple[int, int], int]]
" -- something like "TimeValues
", add "TimeValues
" to "TimePair
"... then use TimePair wherever possible instead ofS[U[T[i,i,i]]
TimePair
has replaced similar object instances, pull the_to_ranges
code into it as member methodsSequence[Union[Tuple[str, str], str]
"The text was updated successfully, but these errors were encountered: