Taragolis commented on code in PR #39211:
URL: https://github.com/apache/airflow/pull/39211#discussion_r1577606267


##########
airflow/utils/db_cleanup.py:
##########
@@ -167,7 +168,7 @@ def _do_delete(*, query, orm_model, skip_archive, session):
         # MySQL with replication needs this split into two queries, so just do 
it for all MySQL
         # ERROR 1786 (HY000): Statement violates GTID consistency: CREATE 
TABLE ... SELECT.
         session.execute(text(f"CREATE TABLE {target_table_name} LIKE 
{orm_model.name}"))
-        metadata = reflect_tables([target_table_name], session)
+        metadata.reflect(bind, only=[target_table_name])

Review Comment:
   BTW, locally it cover this case in MySQL backend in 
`tests/utils/test_db_cleanup.py::TestDBCleanup::test__cleanup_table`



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

Reply via email to