diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2024-05-06 12:56:59 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2024-05-06 13:04:27 +0300 |
commit | 3635be4c02929a9a199fdc2320065eb1c8c28168 (patch) | |
tree | 1e55e7c0f3f9550132694f26684320435b6bdf79 /contrib | |
parent | db9340f74578f02054d56b136a9faccfe7e29eb4 (diff) | |
download | ydb-3635be4c02929a9a199fdc2320065eb1c8c28168.tar.gz |
Intermediate changes
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/python/ydb/py3/.dist-info/METADATA | 2 | ||||
-rw-r--r-- | contrib/python/ydb/py3/ya.make | 2 | ||||
-rw-r--r-- | contrib/python/ydb/py3/ydb/types.py | 9 | ||||
-rw-r--r-- | contrib/python/ydb/py3/ydb/ydb_version.py | 2 |
4 files changed, 10 insertions, 5 deletions
diff --git a/contrib/python/ydb/py3/.dist-info/METADATA b/contrib/python/ydb/py3/.dist-info/METADATA index 31e64bdc6f..9842d0216b 100644 --- a/contrib/python/ydb/py3/.dist-info/METADATA +++ b/contrib/python/ydb/py3/.dist-info/METADATA @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: ydb -Version: 3.11.2 +Version: 3.11.3 Summary: YDB Python SDK Home-page: http://github.com/ydb-platform/ydb-python-sdk Author: Yandex LLC diff --git a/contrib/python/ydb/py3/ya.make b/contrib/python/ydb/py3/ya.make index 99b2cc9f4d..b9639b750d 100644 --- a/contrib/python/ydb/py3/ya.make +++ b/contrib/python/ydb/py3/ya.make @@ -2,7 +2,7 @@ PY3_LIBRARY() -VERSION(3.11.2) +VERSION(3.11.3) LICENSE(Apache-2.0) diff --git a/contrib/python/ydb/py3/ydb/types.py b/contrib/python/ydb/py3/ydb/types.py index f9c6f93645..49792ed39e 100644 --- a/contrib/python/ydb/py3/ydb/types.py +++ b/contrib/python/ydb/py3/ydb/types.py @@ -5,7 +5,7 @@ import abc import enum import json from . import _utilities, _apis -from datetime import date, datetime, timedelta +from datetime import date, datetime, timedelta, timezone import typing import uuid import struct @@ -22,6 +22,7 @@ except ImportError: _SECONDS_IN_DAY = 60 * 60 * 24 _EPOCH = datetime(1970, 1, 1) +_EPOCH_UTC = datetime(1970, 1, 1, tzinfo=timezone.utc) def _from_date(x: ydb_value_pb2.Value, table_client_settings: table.TableClientSettings) -> typing.Union[date, int]: @@ -89,7 +90,11 @@ def _from_timestamp( def _to_timestamp(pb: ydb_value_pb2.Value, value: typing.Union[datetime, int]): if isinstance(value, datetime): - pb.uint64_value = _timedelta_to_microseconds(value - _EPOCH) + if value.tzinfo: + epoch = _EPOCH_UTC + else: + epoch = _EPOCH + pb.uint64_value = _timedelta_to_microseconds(value - epoch) else: pb.uint64_value = value diff --git a/contrib/python/ydb/py3/ydb/ydb_version.py b/contrib/python/ydb/py3/ydb/ydb_version.py index a5b8a0a4e9..7504dfd9c1 100644 --- a/contrib/python/ydb/py3/ydb/ydb_version.py +++ b/contrib/python/ydb/py3/ydb/ydb_version.py @@ -1 +1 @@ -VERSION = "3.11.2" +VERSION = "3.11.3" |