99import struct
1010from google .protobuf import struct_pb2
1111
12- from .table import TableClientSettings
12+ from . import table
1313
1414
1515if typing .TYPE_CHECKING :
2222
2323def _from_date (
2424 x : ydb_value_pb2 .Value ,
25- table_client_settings : TableClientSettings
25+ table_client_settings : table . TableClientSettings
2626) -> typing .Union [date , int ]:
2727 if table_client_settings is not None and table_client_settings ._native_date_in_result_sets :
2828 return _EPOCH .date () + timedelta (days = x .uint32_value )
@@ -38,7 +38,7 @@ def _to_date(pb: ydb_value_pb2.Value, value: typing.Union[date, int]) -> None:
3838
3939def _from_datetime_number (
4040 x : typing .Union [float , datetime ],
41- table_client_settings : TableClientSettings
41+ table_client_settings : table . TableClientSettings
4242) -> datetime :
4343 if table_client_settings is not None and table_client_settings ._native_datetime_in_result_sets :
4444 return datetime .utcfromtimestamp (x )
@@ -47,7 +47,7 @@ def _from_datetime_number(
4747
4848def _from_json (
4949 x : typing .Union [str , bytearray , bytes ],
50- table_client_settings : TableClientSettings
50+ table_client_settings : table . TableClientSettings
5151):
5252 if table_client_settings is not None and table_client_settings ._native_json_in_result_sets :
5353 return json .loads (x )
@@ -56,7 +56,7 @@ def _from_json(
5656
5757def _to_uuid (
5858 value_pb : ydb_value_pb2 .Value ,
59- table_client_settings : TableClientSettings
59+ table_client_settings : table . TableClientSettings
6060) -> uuid .UUID :
6161 return uuid .UUID (bytes_le = struct .pack ("QQ" , value_pb .low_128 , value_pb .high_128 ))
6262
@@ -68,7 +68,7 @@ def _from_uuid(pb: ydb_value_pb2.Value, value: uuid.UUID):
6868
6969def _from_interval (
7070 value_pb : ydb_value_pb2 .Value ,
71- table_client_settings : TableClientSettings
71+ table_client_settings : table . TableClientSettings
7272) -> typing .Union [timedelta , int ]:
7373 if table_client_settings is not None and table_client_settings ._native_interval_in_result_sets :
7474 return timedelta (microseconds = value_pb .int64_value )
@@ -88,7 +88,7 @@ def _to_interval(pb: ydb_value_pb2.Value, value: typing.Union[timedelta, int]) -
8888
8989def _from_timestamp (
9090 value_pb : ydb_value_pb2 .Value ,
91- table_client_settings : TableClientSettings
91+ table_client_settings : table . TableClientSettings
9292) -> typing .Union [datetime , int ]:
9393 if table_client_settings is not None and table_client_settings ._native_timestamp_in_result_sets :
9494 return _EPOCH + timedelta (microseconds = value_pb .uint64_value )
@@ -172,7 +172,7 @@ def __init__(
172172 def get_value (
173173 self ,
174174 value_pb : ydb_value_pb2 .Value ,
175- table_client_settings : TableClientSettings
175+ table_client_settings : table . TableClientSettings
176176 ):
177177 """
178178 Extracts value from protocol buffer
0 commit comments