Skip to content

Commit

Permalink
Fix PostgresToGCSOperat bool dtype (#25475)
Browse files Browse the repository at this point in the history
When converting postgres boolean data type it was defaulting to the
parquet parquet.string() data type. Pyarrow would then raise an error
when attempting to convert the boolean data type into its string.

Changing the PostgresToGCSOperator class map `data_type` to convert
postgres boolean type to bigquery `BOOL` data type which then maps to
the parquet `pa.bool_()` data type when `_convert_parquet_schema` is
called.
  • Loading branch information
dclandau committed Aug 2, 2022
1 parent 4da2b0c commit faf3c4f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class PostgresToGCSOperator(BaseSQLToGCSOperator):
20: 'INTEGER',
21: 'INTEGER',
23: 'INTEGER',
16: 'BOOLEAN',
16: 'BOOL',
700: 'FLOAT',
701: 'FLOAT',
1700: 'FLOAT',
Expand Down

0 comments on commit faf3c4f

Please sign in to comment.