def row_to_json(row, schema, as_object=False): if as_object: row_raw = {'f': [{'v': row}]} schema_raw = [{ 'name': 'wrapper', 'type': 'RECORD', 'mode': 'REQUIRED', 'fields': schema }] return _row_tuple_from_json(row_raw, schema_raw)[0] else: row_raw = row schema_raw = schema return list(_row_tuple_from_json(row_raw, schema_raw))
def _call_fut(self, row, schema): from google.cloud.bigquery._helpers import _row_tuple_from_json return _row_tuple_from_json(row, schema)
def _call_fut(self, row, schema): from google.cloud.bigquery._helpers import _row_tuple_from_json with _field_isinstance_patcher(): return _row_tuple_from_json(row, schema)