Hello, how should I pass defined parameter (prefec...
# prefect-server
t
Hello, how should I pass defined parameter (prefect input) to a MySQLExecute query param? query expects string 😕
n
Hi @Tadas - you could wrap the MySQLExecute task OR extend it such that it would expect a parameter. I don't have a great example for that task in particular but this is how I would do it with the
ShellTask
, which also expects a string:
Copy code
class Clone(ShellTask):
    def run(self, dynamic_param):
        token = auth_secret
        self.command = f"git clone {dynamic_param}"
        super(Clone, self).run()
But in your case you might instead use
self.query = "{dynamic_param}"
🙂
t
Hey, sorry I didn’t get back to you yesterday - I went to sleep. I think I solved it with adding additional StringFormatter task and passing its output to MySQLExecute query 🙂