This commit is contained in:
AAfghahi
2021-10-08 13:19:04 -04:00
committed by GitHub
parent a6173f1929
commit e32a12fa0b
2 changed files with 10 additions and 3 deletions

View File

@@ -551,6 +551,10 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
});
// cast the new encrypted extra object into a string
dbToUpdate.encrypted_extra = JSON.stringify(additionalEncryptedExtra);
// this needs to be added by default to gsheets
if (dbToUpdate.engine === 'gsheets') {
dbToUpdate.impersonate_user = true;
}
}
if (dbToUpdate?.parameters?.catalog) {

View File

@@ -153,9 +153,12 @@ class GSheetsEngineSpec(SqliteEngineSpec):
cls, parameters: GSheetsParametersType,
) -> List[SupersetError]:
errors: List[SupersetError] = []
encrypted_credentials = json.loads(
parameters.get("service_account_info") or "{}"
)
encrypted_credentials = parameters.get("service_account_info") or "{}"
# On create the encrypted credentials are a string,
# at all other times they are a dict
if isinstance(encrypted_credentials, str):
encrypted_credentials = json.loads(encrypted_credentials)
table_catalog = parameters.get("catalog", {})