-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
The seconds format specifier is wrong when outputting to CSV #4895
Comments
This can probably be fixed along with #4820. |
The bug is here: redash/redash/serializers/query_result.py Lines 11 to 20 in b117485
It translates |
Just want to confirm, according to python docs here, the above code should be changed to def _convert_format(fmt):
return (
fmt.replace("DD", "%d")
.replace("MM", "%m")
.replace("YYYY", "%Y")
.replace("YY", "%y")
.replace("HH", "%H")
.replace("mm", "%M")
.replace("ss", "%S")
.replace("SSS", "%f")
) However, the string will be fixed at 6-digit microsecond, not 3-digit millisecond as the following screenshot If you consider this behavior is not harmful to other functions, I can implement it and make PR. |
Considering it currently prints the Unix timestamp, having 6 digits instead of 3 should be a great step forward ;-) A PR will be appreciated. Thanks! |
I guess you can just cut off last three digits after formatting and it will work just fine |
@kravets-levko but then you need to know when microseconds are used or not.. easier to leave as is. |
cutting a string after formatting needs extra implementation. I don't think we should do that way. I will stick with 6-digit solution and make a PR |
Issue Summary
The seconds format specifier is wrong when outputting to CSV.
Steps to Reproduce
SELECT CURRENT_TIMESTAMP()
in BigQuery).Seconds will not be printed, unix time of the date-time data will be printed.
For example, "2020-05-15T19:34:36.664" will output "2020-05-15T19:34:1589538876664".
Technical details:
redash/redash:8.0.2.b37747
The text was updated successfully, but these errors were encountered: