Conversation
|
💵 To receive payouts, sign up on Algora, link your Github account and connect with Stripe/Alipay. |
coszio
left a comment
There was a problem hiding this comment.
Great work here @xzfc!
My only concern is the at the api layer. We should keep the Range type at this level to not break backward compatibility in the clients. A newtype instead of generic for datetime range may fix this.
Also, I would love the tests to include some non-UTC timezone examples as a sanity check.
|
Some comments on your open questions, but I haven't gone through your code yet:
I think this is a good choice. This way we have a constant resolution of 1 millisecond, while we'd loose precision with f64. Though, what's the maximum value we can represent here if milliseconds and i64? Later we can add parameterization to this to support different resolutions, seconds or nanoseconds for example. Each could have an optimized index variant. I do wonder whether we'd somehow want to make this timezone aware as well. Maybe we shouldn't care for the index and always use UTC.
Perfect. Following a solid standard. |
I've checked the supported datetime ranges for chrono library and i64 values.
I'll switch to microseconds for now if you don't have objections. |
|
@xzfc Thank you so much for diving into this.
No objections, we can extend/change this later if desired. |
62381ba to
41d5134
Compare
coszio
left a comment
There was a problem hiding this comment.
Thanks for improving this @xzfc, looks much better now.
I made a few improvements to push this to the endline:
- restored the enum variant approach
- other minor stuff
I'm not sure how much I like approving macros, which are hard to maintain, but we can refactor that later.
| #[macro_rules_attribute::macro_rules_derive(crate::common::macros::schemars_rename_generics)] | ||
| #[derive_args(<FloatPayloadType> => "Range", <DateTimePayloadType> => "DatetimeRange")] |
d4c8d81 to
03d3a9a
Compare
12b3ac6 to
469c060
Compare
This reverts commit d55f251.
This reverts commit c5255f6.
469c060 to
11788ad
Compare
* Datetime payload index * Introduce IndexMapItem * Drop FieldIndex::DatetimeIndex * Rename OpenAPI struct names * Switch to microseconds * Validate and serialize grpc timestamps * Add tests with different timezones * minor review fixes * Revert "Drop FieldIndex::DatetimeIndex" This reverts commit d55f251. * Revert "Introduce IndexMapItem" This reverts commit c5255f6. * fix: back to microseconds after reverts * extract range conversion from boxed checker fn * add log to deps * don't run macro doctest * no_run -> ignore * remove prost-types in favor of prost-wkt-types * better assertion on test_payload_indexing.py * propagate unparsable datetime --------- Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
This PR adds datetime payload index. /claim #3320
Open for discussion/feedback:
i64. Possible alternatives: nanoseconds inu64or seconds inf64.2019-01-01T00:00:00.000Z.datetime_rangeis a separate key. Need to investigate if this could be merged with therangekey in a straightforward way.All Submissions:
devbranch. Did you create your branch fromdev?New Feature Submissions:
cargo +nightly fmt --allcommand prior to submission?cargo clippy --all --all-featurescommand?Changes to Core Features: