File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
bigquery/google/cloud/bigquery Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -1644,6 +1644,22 @@ def load_table_from_json(
16441644 json_rows (Iterable[Dict[str, Any]]):
16451645 Row data to be inserted. Keys must match the table schema fields
16461646 and values must be JSON-compatible representations.
1647+
1648+ .. note::
1649+
1650+ If your data is already a newline-delimited JSON string,
1651+ it is best to wrap it into a file-like object and pass it
1652+ to :meth:`~google.cloud.bigquery.client.Client.load_table_from_file`::
1653+
1654+ import io
1655+ from google.cloud import bigquery
1656+
1657+ data = u'{"foo": "bar"}'
1658+ data_as_file = io.StringIO(data)
1659+
1660+ client = bigquery.Client()
1661+ client.load_table_from_file(data_as_file, ...)
1662+
16471663 destination (Union[ \
16481664 :class:`~google.cloud.bigquery.table.Table`, \
16491665 :class:`~google.cloud.bigquery.table.TableReference`, \
You can’t perform that action at this time.
0 commit comments