dilnazanlid commented on code in PR #72474:
URL: https://github.com/apache/airflow/pull/72474#discussion_r4045852069
##########
airflow-core/src/airflow/api/common/delete_dag.py:
##########
@@ -80,9 +80,10 @@ def delete_dag(dag_id: str, keep_records_in_log: bool =
True, *, session: Sessio
# Delete entries in Import Errors table for a deleted Dag
# This handles the case when the dag_id is changed in the file
+ targets = [ref for ref in (dag.relative_fileloc, dag.fileloc) if ref]
session.execute(
delete(ParseImportError).where(
- ParseImportError.filename == dag.relative_fileloc,
+ ParseImportError.source_reference.in_(targets),
Review Comment:
done
--
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]