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 2021/01/11 16:01:23 UTC

[GitHub] [superset] villebro commented on a change in pull request #11720: feat(db-engine-specs): add support for Postgres root cert

villebro commented on a change in pull request #11720:
URL: https://github.com/apache/superset/pull/11720#discussion_r555156788



##########
File path: superset/db_engine_specs/postgres.py
##########
@@ -115,3 +119,28 @@ def convert_dttm(cls, target_type: str, dttm: datetime) -> Optional[str]:
             dttm_formatted = dttm.isoformat(sep=" ", timespec="microseconds")
             return f"""TO_TIMESTAMP('{dttm_formatted}', 'YYYY-MM-DD HH24:MI:SS.US')"""
         return None
+
+    @staticmethod
+    def get_extra_params(database: "Database") -> Dict[str, Any]:
+        """
+        For Postgres, the path to a SSL certificate is placed in `connect_args`.
+
+        :param database: database instance from which to extract extras
+        :raises CertificateException: If certificate is not valid/unparseable
+        :raises JSONDecodeError: If database extra json payload is unparseable
+        """
+        try:
+            extra = json.loads(database.extra or "{}")
+        except json.JSONDecodeError as ex:
+            logger.error(ex)

Review comment:
       Good point, replaced with generic `SupersetException`.




----------------------------------------------------------------
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.

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