Domantas
04/08/2021, 1:37 PMhost
Parameter as MySQLExecute
argument?
Pseudo code:
from prefect.tasks.mysql.mysql import MySQLExecute
from prefect import Flow, Parameter
example_query = MySQLExecute(
name="example_query",
db_name="db name",
user="some user",
password="123456",
port=1234,
query="select * from example_table;"
)
with Flow("example") as f:
db_host = Parameter("db_host", default="host_address")
mysql_execute = example_query(host=db_host)
when I execute this pseaudo code, I get this error:
TypeError: __init__() missing 1 required positional argument: 'host'
According to documentation: https://docs.prefect.io/api/latest/tasks/mysql.html#mysqlexecute , host
argument is not optional, so by default it is required to be defined in a MySQLExcute
function.
Maybe there is a proper way to pass host
value to the MySQLExecute
function?Kevin Kho
Domantas
04/08/2021, 1:48 PMKevin Kho