-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
feat(rust, python): avoid panic error in strftime with invalid format #6810
Conversation
"{}", | ||
Utc.from_local_datetime(&dt).earliest().unwrap().format(fmt) | ||
), | ||
_ => format!("{}", dt.format(fmt)), | ||
) { |
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 think it is cleaner to write something like this:
write!().map_err(|_| PolarsError::ComputeError(..))?;
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.
right, that's better - thanks!
)); | ||
} | ||
}, | ||
_ => match write!(fmted, "{}", dt.format(fmt)) { |
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.
See comment above.
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.
Thanks @MarcoGorelli. I have a small clippy like comment. Other than than that great additon. Errors > panics!
On the latest release it looks like this:
Here: