-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Miscellaneous fixes to BigQuery connector (#959)
* Test nullable column types are parsed correctly for BigQuery * Prefer not NoneType when inferring schema for Table load to BigQuery If a Parsons Table column has values like `[None, None, True, False]`, the BigQuery connector will infer that the appropriate type for this column is NoneType, which it will translate into a STRING type. This change ensures that types returned by petl.typecheck() will choose the first available type that isn't 'NoneType' if that is available. * Fix BigQuery type map Source types ultimately come from `petl.typeset`, which calls `type(v).__name__`. This call does not include source module, but only the type name itself. e.g. `date` and not `datetime.date` * Fix commented out row to use job_config passed as argument It looks like this line was accidentally commented out * Parse python datetime objects for BigQuery as datetime or timestamp Python datetime objects may represent timestamps or datetimes in BigQuery, depending on whether they do or do not have a timezone attached. * Only generate schema for BigQuery when table does not already exist Always passing a schema to BigQuery is not necessary, and introduces situations for provided schema to mismatch actual schema. When table already exists in BigQuery, fetch the schema from BigQuery * Ensure that schema and Table columns align --------- Co-authored-by: Cormac Martinez del Rio <[email protected]>
- Loading branch information
1 parent
0d68302
commit e515096
Showing
2 changed files
with
68 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters