move-coop / parsons

A python library of connectors for the progressive community.
Other
255 stars 125 forks source link

992 bug parsons bigquery upsert is broken #994

Closed willyraedy closed 4 months ago

willyraedy commented 4 months ago

Fixes the upsert bug by adding "template_table" back into the API for the three copy methods (copy, copy_s3, copy_from_gcs).

Moved the schema determination logic into a single private function and moved some error handling into a lower level wrapper of the BQ client's load_table_from_uri. Also, did some basic tidying in a few functions.

These are some of the most central methods in the class. Obviously the unit tests are passing, your test script, and I got halfway through our Catalist load locally. But if people can do some meaningful kicking the tires with integration tests in your projects, I think that would be a good use of time.