Skip to content

Commit 7cbdf22

Browse files
melissachangmax-sixty
authored andcommitted
Add more documentation to to_gbq() table_schema (#217)
* Add more documentation to to_gbq() table_schema * Add note about _generate_bq_schema() not preserving column order * black * pandas_gbq.gbq._generate_bq_schema()
1 parent 661d5df commit 7cbdf22

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

pandas_gbq/gbq.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import logging
32
import os
43
import time
@@ -13,7 +12,6 @@
1312

1413
logger = logging.getLogger(__name__)
1514

16-
1715
BIGQUERY_INSTALLED_VERSION = None
1816
SHOW_VERBOSE_DEPRECATION = False
1917

@@ -837,9 +835,13 @@ def to_gbq(
837835
table_schema : list of dicts, optional
838836
List of BigQuery table fields to which according DataFrame
839837
columns conform to, e.g. ``[{'name': 'col1', 'type':
840-
'STRING'},...]``. If schema is not provided, it will be
841-
generated according to dtypes of DataFrame columns. See
842-
BigQuery API documentation on available names of a field.
838+
'STRING'},...]``.
839+
If schema is not provided, it will be
840+
generated according to dtypes of DataFrame columns.
841+
If schema is provided, it must contain all DataFrame columns.
842+
pandas_gbq.gbq._generate_bq_schema() may be used to create an initial
843+
schema, though it doesn't preserve column order.
844+
See BigQuery API documentation on available names of a field.
843845
844846
.. versionadded:: 0.3.1
845847
location : str, optional

0 commit comments

Comments
 (0)