Conversation
Parse default `chrono::DateTime::to_string` format
...to ensure `DateTimeWrapper::from_str` can successfully parse `DateTimeWrapper::to_string` output
ffuugoo
commented
Jul 29, 2025
Comment on lines
+84
to
+90
| ParsedExpression::Datetime(DatetimeExpression::Constant(dt_str.parse().map_err( | ||
| |err: chrono::ParseError| { | ||
| CollectionError::bad_input(format!( | ||
| "failed to parse date-time {dt_str:?}: {err}" | ||
| )) | ||
| }, | ||
| )?)) |
Contributor
Author
There was a problem hiding this comment.
This change is optional, but would have been nice to have better errors during parsing. Would have trivialized solving this issue even more.
ffuugoo
commented
Jul 29, 2025
Comment on lines
+102
to
+103
| // Attempt to parse default to-string format | ||
| .or_else(|_| chrono::DateTime::from_str(s)) |
Contributor
Author
There was a problem hiding this comment.
According to chrono documentation, FromStr implementation:
Accepts a relaxed form of RFC3339. A space or a ‘T’ are accepted as the separator between the date and time parts. Additional spaces are allowed between each component.
Which seems exactly what we want here? Maybe we can even put this as the first parser we try, before even parse_from_rfc3339.
This comment was marked as resolved.
This comment was marked as resolved.
timvisee
reviewed
Jul 29, 2025
timvisee
approved these changes
Jul 29, 2025
9 tasks
timvisee
pushed a commit
that referenced
this pull request
Aug 11, 2025
Merged
2 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
DateTimeWrappercould not parse it's ownto_stringoutput. Oops. Fixed now.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: