Bug in Double application of Google Creds utility #685
Labels
bug
Impact - something is currently broken in Parsons and needs to be fixed
connector update
Work type - additions or changes to the functions of an existing Parsons connector
good first issue
These issues are great ones to start working on for Parsons newcomers!
medium priority
Priority - this doesn't need to be addressed immediately, but will broadly impact Parsons users
The
setup_google_application_credentials()
utility is applied twice in any use of theGoogleBigQuery
connector that usescopy()
or any other method that also instantiates theGoogleCloudStorage
class.Both of these classes make use of the
setup_google_application_credentials()
utility, which works fine the first time it's applied. The result under most conditions is that theGOOGLE_APPLICATION_CREDENTIALS
env var is populated with the path to the temporary .json file holding the credentials.The problem is that the second time this is applied, a temporary file is created whose contents are merely the path to the first temporary file, and the various clients involved don't know what to do with that. They try to parse that nested file path as a JSON string, and of course it throws an error.
I believe this might be most easily fixed by adding another condition to the
if
block to handle this edge case:The text was updated successfully, but these errors were encountered: