You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/07/19 10:25:20 UTC

[GitHub] [airflow] oyarushe commented on a change in pull request #17080: Parse JSON template parameters field for MySQL operator

oyarushe commented on a change in pull request #17080:
URL: https://github.com/apache/airflow/pull/17080#discussion_r672177659



##########
File path: airflow/providers/mysql/operators/mysql.py
##########
@@ -67,6 +70,11 @@ def __init__(
         self.parameters = parameters
         self.database = database
 
+    def prepare_template(self) -> None:
+        """Parse JSON template file for attribute parameter."""
+        if isinstance(self.parameters, str):
+            self.parameters = ast.literal_eval(self.parameters)

Review comment:
       I thought about it, but I found in the code that we are using this approach, for example:
   https://github.com/apache/airflow/blob/177dfbd12a42a5c229640c6c830f43f280ea5caa/airflow/providers/amazon/aws/operators/emr_create_job_flow.py#L74-L78




-- 
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: commits-unsubscribe@airflow.apache.org

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