task. I have no error (i had some but i fixed them) but the row i try to insert isn't showing in the table. I can do it with the same user from mysql workbench and the
MySqlExecute
task return 1 as expected. I don't understand why, maybe i'm doing something wrong. Here is a code example of my task:
Copy code
@task
def set_new_date():
logger = prefect.context.get("logger")
new_date = datetime.date.today().strftime("%Y-%m-%d")
query = f"""
INSERT INTO `name`.`table_name` (`name`, `value`) VALUES ('name', '{new_date}');
"""
result = MySQLExecute(
db_name="name",
user="user",
password="pwd",
host="host",
port=3306,
query=query).run()
<http://logger.info|logger.info>("New date is {}".format(new_date))
<http://logger.info|logger.info>("Query results is {}".format(result))
k
Kevin Kho
05/12/2022, 4:14 PM
It’s hard to tell. This looks right. When happens when you use
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.