|
21 | 21 | importbase64 |
22 | 22 | importthreading |
23 | 23 | importlogging |
| 24 | +importuuid |
24 | 25 |
|
25 | 26 | fromgoogle.protobuf.struct_pb2importListValue |
26 | 27 | fromgoogle.protobuf.struct_pb2importValue |
@@ -298,6 +299,8 @@ def _make_value_pb(value): |
298 | 299 | returnValue(string_value=base64.b64encode(value)) |
299 | 300 | ifisinstance(value, Interval): |
300 | 301 | returnValue(string_value=str(value)) |
| 302 | +ifisinstance(value, uuid.UUID): |
| 303 | +returnValue(string_value=str(value)) |
301 | 304 |
|
302 | 305 | raiseValueError("Unknown type: %s"% (value,)) |
303 | 306 |
|
@@ -399,6 +402,8 @@ def _get_type_decoder(field_type, field_name, column_info=None): |
399 | 402 | return_parse_numeric |
400 | 403 | eliftype_code==TypeCode.JSON: |
401 | 404 | return_parse_json |
| 405 | +eliftype_code==TypeCode.UUID: |
| 406 | +return_parse_uuid |
402 | 407 | eliftype_code==TypeCode.PROTO: |
403 | 408 | returnlambdavalue_pb: _parse_proto(value_pb, column_info, field_name) |
404 | 409 | eliftype_code==TypeCode.ENUM: |
@@ -481,6 +486,10 @@ def _parse_json(value_pb): |
481 | 486 | returnJsonObject.from_str(value_pb.string_value) |
482 | 487 |
|
483 | 488 |
|
| 489 | +def_parse_uuid(value_pb): |
| 490 | +returnuuid.UUID(value_pb.string_value) |
| 491 | + |
| 492 | + |
484 | 493 | def_parse_proto(value_pb, column_info, field_name): |
485 | 494 | bytes_value=base64.b64decode(value_pb.string_value) |
486 | 495 | ifcolumn_infoisnotNoneandcolumn_info.get(field_name) isnotNone: |
|
0 commit comments