(value)
| 1124 | |
| 1125 | |
| 1126 | def as_record(value): |
| 1127 | if isinstance(value, Field): |
| 1128 | return value |
| 1129 | elif isinstance(value, list) or isinstance(value, tuple): |
| 1130 | is_field_list = all( |
| 1131 | f is tuple and len(f) == 2 and isinstance(f[0], basestring) |
| 1132 | for f in value |
| 1133 | ) |
| 1134 | if is_field_list: |
| 1135 | return Struct(* [(k, as_record(v)) for k, v in value]) |
| 1136 | else: |
| 1137 | return Tuple(* [as_record(f) for f in value]) |
| 1138 | elif isinstance(value, dict): |
| 1139 | return Struct(* [(k, as_record(v)) for k, v in value.items()]) |
| 1140 | else: |
| 1141 | return _normalize_field(value) |
| 1142 | |
| 1143 | |
| 1144 | def FetchRecord(blob_record, ws=None, throw_on_type_mismatch=False): |
no test coverage detected
searching dependent graphs…