betodealmeida commented on code in PR #38075:
URL: https://github.com/apache/superset/pull/38075#discussion_r2824550107


##########
superset/db_engine_specs/bigquery.py:
##########
@@ -192,6 +192,9 @@ class BigQueryEngineSpec(BaseEngineSpec):  # pylint: 
disable=too-many-public-met
     # when editing the database, mask this field in `encrypted_extra`
     # pylint: disable=invalid-name
     encrypted_extra_sensitive_fields = {"$.credentials_info.private_key"}
+    encrypted_extra_sensitive_field_labels = {
+        "$.credentials_info.private_key": "Service Account Private Key",
+    }

Review Comment:
   I think it would be better to just make `encrypted_extra_sensitive_fields: 
set[str] | dict[str, str]` for now, and where we consume it we do:
   
   ```python
   fields = (
       {field: field for field in encrypted_extra_sensitive_fields}
       if isinstance(encrypted_extra_sensitive_fields, set)
       else encrypted_extra_sensitive_fields
   )
   ```
   
   Then in 7.0 we make `encrypted_extra_sensitive_fields: dict[str, str]` only.
   
   Otherwise we need to keep `encrypted_extra_sensitive_fields` and 
`encrypted_extra_sensitive_field_labels` in sync, ensuring they have the same 
keys.
   
   We could also be fancy and try to autogenerate a label when 
`encrypted_extra_sensitive_fields` is a set, like:
   
   ```python
   def generate_field_label(key: str) -> str:
       return " ".join(part.title() for part in key[2:].replace("_", " 
").split(".")
   ```
   
   But it might not be worth the trouble.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to