mirror of https://github.com/apache/superset.git
fix: Big Query Edit Form (#14850)
* fix big quert edit form * fix test * fix api test * fix test
This commit is contained in:
parent
e466066229
commit
ae8378a50e
|
@ -1372,7 +1372,9 @@ class BasicParametersMixin:
|
|||
)
|
||||
|
||||
@classmethod
|
||||
def get_parameters_from_uri(cls, uri: str) -> BasicParametersType:
|
||||
def get_parameters_from_uri(
|
||||
cls, uri: str, encrypted_extra: Optional[Dict[str, Any]] = None
|
||||
) -> BasicParametersType:
|
||||
url = make_url(uri)
|
||||
encryption = all(
|
||||
item in url.query.items() for item in cls.encryption_parameters.items()
|
||||
|
|
|
@ -49,7 +49,7 @@ ma_plugin = MarshmallowPlugin()
|
|||
|
||||
class BigQueryParametersSchema(Schema):
|
||||
credentials_info = EncryptedField(
|
||||
description="Contents of BigQuery JSON credentials.",
|
||||
required=True, description="Contents of BigQuery JSON credentials.",
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -246,7 +246,8 @@ class Database(
|
|||
self.db_engine_spec, "get_parameters_from_uri"
|
||||
):
|
||||
uri = make_url(self.sqlalchemy_uri_decrypted)
|
||||
return {**parameters, **self.db_engine_spec.get_parameters_from_uri(uri)} # type: ignore
|
||||
encrypted_extra = self.get_encrypted_extra()
|
||||
return {**parameters, **self.db_engine_spec.get_parameters_from_uri(uri, encrypted_extra=encrypted_extra)} # type: ignore
|
||||
|
||||
return parameters
|
||||
|
||||
|
|
|
@ -1448,6 +1448,7 @@ class TestDatabaseApi(SupersetTestCase):
|
|||
"x-encrypted-extra": True,
|
||||
}
|
||||
},
|
||||
"required": ["credentials_info"],
|
||||
"type": "object",
|
||||
},
|
||||
"preferred": True,
|
||||
|
|
Loading…
Reference in New Issue