diff options
author | robot-contrib <robot-contrib@yandex-team.com> | 2023-11-24 07:29:28 +0300 |
---|---|---|
committer | robot-contrib <robot-contrib@yandex-team.com> | 2023-11-24 08:02:00 +0300 |
commit | 778162c87fe52768297a4e767461054aa9c94dfe (patch) | |
tree | 01fb8c8a47a4ed9024449295a80df8b61ad9dc63 /contrib/python/clickhouse-connect/clickhouse_connect/driver/query.py | |
parent | 7ca783ae1c82067d566b9b73e3f67dff078401bc (diff) | |
download | ydb-778162c87fe52768297a4e767461054aa9c94dfe.tar.gz |
Update contrib/python/clickhouse-connect to 0.6.20
Diffstat (limited to 'contrib/python/clickhouse-connect/clickhouse_connect/driver/query.py')
-rw-r--r-- | contrib/python/clickhouse-connect/clickhouse_connect/driver/query.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/python/clickhouse-connect/clickhouse_connect/driver/query.py b/contrib/python/clickhouse-connect/clickhouse_connect/driver/query.py index c4a48aafe0..3fb5aa7dac 100644 --- a/contrib/python/clickhouse-connect/clickhouse_connect/driver/query.py +++ b/contrib/python/clickhouse-connect/clickhouse_connect/driver/query.py @@ -391,8 +391,8 @@ def format_query_value(value: Any, server_tz: tzinfo = pytz.UTC): if isinstance(value, str): return format_str(value) if isinstance(value, datetime): - if value.tzinfo is None: - value = value.replace(tzinfo=server_tz) + if value.tzinfo is not None or server_tz != pytz.UTC: + value = value.astimezone(server_tz) return f"'{value.strftime('%Y-%m-%d %H:%M:%S')}'" if isinstance(value, date): return f"'{value.isoformat()}'" |