ishmulyan commented on code in PR #36003:
URL: https://github.com/apache/superset/pull/36003#discussion_r2495213454


##########
superset/db_engine_specs/athena.py:
##########
@@ -92,3 +94,39 @@ def _mutate_label(label: str) -> str:
         :return: Conditionally mutated label
         """
         return label.lower()
+
+    @classmethod
+    def adjust_engine_params(
+        cls,
+        uri: URL,
+        connect_args: dict[str, Any],
+        catalog: str | None = None,
+        schema: str | None = None,
+    ) -> tuple[URL, dict[str, Any]]:
+        """
+        Adjust the SQLAlchemy URI for Athena with a provided schema.
+
+        For AWS Athena the SQLAlchemy URI looks like this:
+
+            
awsathena+rest://{aws_access_key_id}:{aws_secret_access_key}@athena.{region_name}.amazonaws.com:443/{schema_name}?s3_staging_dir={s3_staging_dir}&...
+        """
+        if not schema:
+            return uri, connect_args
+
+        uri = uri.set(database=schema)
+        return uri, connect_args

Review Comment:
   I have updated the PR with the updated code



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