feat(add-db): Add Big Query Form - #14535
Conversation
Codecov Report
@@ Coverage Diff @@
## master #14535 +/- ##
=======================================
Coverage 77.54% 77.54%
=======================================
Files 958 958
Lines 48541 48541
Branches 5702 5702
=======================================
Hits 37640 37640
Misses 10700 10700
Partials 201 201
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
| def build_sqlalchemy_url(cls, parameters: BigQueryParametersType) -> str: | ||
| project_id = ( | ||
| parameters.get("credentials_json", {}) | ||
| .get("credentials_info", {}) | ||
| .get("project_id") | ||
| ) | ||
|
|
||
| return f"{cls.drivername}://{project_id}" |
There was a problem hiding this comment.
One thing we might consider this is that we would have to pass the credentials info in two different places: secure_extra and parameters. We need to pass it in secure_extra so it's stored encrypted in the database (in the encrypted_extra column). But I think this is fine for now.
There was a problem hiding this comment.
Also, @eschutho, should we use brackets or triple slashes here? I remember you had problems with this before.
|
|
||
| class BigQueryEngineSpec(BaseEngineSpec): | ||
| class BigQueryParametersSchema(Schema): | ||
| credentials_json = fields.Dict( |
There was a problem hiding this comment.
Should we be more specific here, to leverage Marshmallow validation? The credentials looks like this:
{
"type": "service_account",
"project_id": "optimal-aurora-285000",
"private_key_id": "a1a0f6e452b06c145878f283fcb2d252759b97a3",
"private_key": "-----BEGIN PRIVATE KEY-----\nXXX\n-----END PRIVATE KEY-----\n",
"client_email": "superset@optimal-aurora-285000.iam.gserviceaccount.com",
"client_id": "114899578697537931695",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/superset%40optimal-aurora-285000.iam.gserviceaccount.com"
}Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
|
Closing in favor of #14700 |
SUMMARY
Creating a big query form parameters to allow for integration with new db modal flow. Users will have a custom form to setup their big query connections. This is only the backend piece, a follow up ticket will have the frontend handling the custom form.
Also patched the pylint to allow us to have the abstract methods not duplicated in every engine until we implement them
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TEST PLAN
ADDITIONAL INFORMATION