Skip to content

Commit

Permalink
generate_schema.py: add comment to explain the 'Q' types
Browse files Browse the repository at this point in the history
  • Loading branch information
bxparks committed Nov 2, 2023
1 parent 79c7ef2 commit a7646e6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bigquery_schema_generator/generate_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,10 @@ def convert_type(atype, btype):
* [Q]FLOAT + [Q]INTEGER => FLOAT (except QFLOAT + QINTEGER)
* (DATE, TIME, TIMESTAMP, QBOOLEAN, QINTEGER, QFLOAT, STRING) +
(DATE, TIME, TIMESTAMP, QBOOLEAN, QINTEGER, QFLOAT, STRING) => STRING
The "Q" refers to the quoted (i.e. string) versions of the various types,
which are needed to emulate the type inference inside quoted strings
performed by BigQuery.
"""
# type + type => type
if atype == btype:
Expand Down

0 comments on commit a7646e6

Please sign in to comment.