You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/09/23 18:15:54 UTC

[GitHub] [superset] eschutho commented on a diff in pull request #21570: fix: catch error when masking encrypted extra is none

eschutho commented on code in PR #21570:
URL: https://github.com/apache/superset/pull/21570#discussion_r978954233


##########
superset/db_engine_specs/bigquery.py:
##########
@@ -396,10 +396,12 @@ def get_parameters_from_uri(
         raise ValidationError("Invalid service credentials")
 
     @classmethod
-    def mask_encrypted_extra(cls, encrypted_extra: str) -> str:
+    def mask_encrypted_extra(
+        cls, encrypted_extra: Union[str, None]
+    ) -> Union[str, None]:
         try:
-            config = json.loads(encrypted_extra)
-        except json.JSONDecodeError:
+            config = json.loads(encrypted_extra)  # type:ignore

Review Comment:
   @betodealmeida the other option here would be to have a default value if encrypted_extra is None, but I opted for including it in the try/catch since it already existed. Of course, this requires the type ignores because the linter isn't aware of the try/except. 



-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org