Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ sqlalchemy==1.4.26
pylint-protobuf
cython
freezegun==1.2.2
pytest-cov
# pytest-cov
yandexcloud
-e .
6 changes: 4 additions & 2 deletions ydb/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ def _from_date(x: ydb_value_pb2.Value, table_client_settings: table.TableClientS
return x.uint32_value


def _to_date(pb: ydb_value_pb2.Value, value: typing.Union[date, int]) -> None:
if isinstance(value, date):
def _to_date(pb: ydb_value_pb2.Value, value: typing.Union[date, datetime, int]) -> None:
if isinstance(value, datetime):
pb.uint32_value = (value.date() - _EPOCH.date()).days
elif isinstance(value, date):
pb.uint32_value = (value - _EPOCH.date()).days
else:
pb.uint32_value = value
Expand Down
Loading