Skip to content

Commit 326e674

Browse files
author
Jim Fulton
authored
docs: clarify table_schema (#383)
1. There must be an input dataframe column for every desired output table column. 2. The types given in table_schema must be BigQuery types (strings). - [x] closes #382 - [x] tests added / passed - [x] passes `nox -s blacken lint`
1 parent ea0f4e9 commit 326e674

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pandas_gbq/gbq.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -927,11 +927,12 @@ def to_gbq(
927927
table_schema : list of dicts, optional
928928
List of BigQuery table fields to which according DataFrame
929929
columns conform to, e.g. ``[{'name': 'col1', 'type':
930-
'STRING'},...]``.
930+
'STRING'},...]``. The ``type`` values must be BigQuery type names.
931931
932932
- If ``table_schema`` is provided, it may contain all or a subset of
933933
DataFrame columns. If a subset is provided, the rest will be
934-
inferred from the DataFrame dtypes.
934+
inferred from the DataFrame dtypes. If ``table_schema`` contains
935+
columns not in the DataFrame, they'll be ignored.
935936
- If ``table_schema`` is **not** provided, it will be
936937
generated according to dtypes of DataFrame columns. See
937938
`Inferring the Table Schema

0 commit comments

Comments
 (0)