Skip to content

Commit

Permalink
docs: clarify table_schema (#383)
Browse files Browse the repository at this point in the history
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`
  • Loading branch information
jimfulton committed Nov 2, 2021
1 parent ea0f4e9 commit 326e674
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pandas_gbq/gbq.py
Expand Up @@ -927,11 +927,12 @@ def to_gbq(
table_schema : list of dicts, optional
List of BigQuery table fields to which according DataFrame
columns conform to, e.g. ``[{'name': 'col1', 'type':
'STRING'},...]``.
'STRING'},...]``. The ``type`` values must be BigQuery type names.
- If ``table_schema`` is provided, it may contain all or a subset of
DataFrame columns. If a subset is provided, the rest will be
inferred from the DataFrame dtypes.
inferred from the DataFrame dtypes. If ``table_schema`` contains
columns not in the DataFrame, they'll be ignored.
- If ``table_schema`` is **not** provided, it will be
generated according to dtypes of DataFrame columns. See
`Inferring the Table Schema
Expand Down

0 comments on commit 326e674

Please sign in to comment.