File tree 1 file changed +16
-0
lines changed
bigquery/google/cloud/bigquery
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(
1644
1644
json_rows (Iterable[Dict[str, Any]]):
1645
1645
Row data to be inserted. Keys must match the table schema fields
1646
1646
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
+
1647
1663
destination (Union[ \
1648
1664
:class:`~google.cloud.bigquery.table.Table`, \
1649
1665
:class:`~google.cloud.bigquery.table.TableReference`, \
You can’t perform that action at this time.
0 commit comments