-
-
Notifications
You must be signed in to change notification settings - Fork 216
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
Incorrect timezone handling when escaping a datetime-aware object #388
Comments
hellais
added a commit
to ooni/data
that referenced
this issue
Nov 20, 2023
For what it's work I am currently replacing the timezone information with It's probably quite important to fix this in light of the recent deprecation in python 3.12 of |
hellais
added a commit
to ooni/data
that referenced
this issue
Nov 21, 2023
* Make utcnow() calls timezone aware * Implement workardound for clickhouse bug mymarilyn/clickhouse-driver#388 * Implement more tests for range deletions * Refactoring of get_prev_range functions * Fix problem in experiment result generation
hellais
added a commit
to ooni/data
that referenced
this issue
Nov 21, 2023
* Make utcnow() calls timezone aware * Implement workardound for clickhouse bug mymarilyn/clickhouse-driver#388 * Implement more tests for range deletions * Refactoring of get_prev_range functions * Fix problem in experiment result generation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Suppose you have a table:
It contains some data. Let the maximum timestamp be 1546300800 (2019-01-01 00:00:00 UTC).
Suppose then that your CH installation resides in Moscow, so its TZ value is "Europe/Moscow"
Then you run the query using clickhouse-driver:
But then a bad thing happens. This piece of code translates your timestamp to server's timezone Europe/Moscow and the resulting query
SELECT * FROM foo WHERE timestamp = '2019-01-01 03:00:00'
returns nothing, because as mentioned in CH's manual string values are treated in column's timezone, not server's one.To Reproduce
See above
Expected behavior
I guess the driver has to deal with timezones more accurately. Treating timestamp string values in server's timezone may be correct if the type of column is not timezone-aware. But if the column has the explicit timezone set then it's obviously wrong to use the server's timezone for conversions.
Versions
The text was updated successfully, but these errors were encountered: