Skip to content

Commit d93c1fd

Browse files
authored
Disables --warn-unused-ignore flag for mypy (#10880)
There is a problem with MyPy's implementation of --warn-unused-ignore flag, that depending on it's incremental or full run it will sometimes throw an "unused ignore" error (entirely randomly it seems). The problem is described (but only workarounded) in python/mypy#2960. The workaround is to disable --warn-unused-ignore flag. There is little harm in having unused ignores and we can clean them up from time to time easily.
1 parent 5cc8e98 commit d93c1fd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

airflow/models/dagrun.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class DagRun(Base, LoggingMixin):
6969

7070
task_instances = relationship(
7171
TI,
72-
primaryjoin=and_(TI.dag_id == dag_id, TI.execution_date == execution_date),
72+
primaryjoin=and_(TI.dag_id == dag_id, TI.execution_date == execution_date), # type: ignore
7373
foreign_keys=(dag_id, execution_date),
7474
backref=backref('dag_run', uselist=False),
7575
)

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ packages = airflow
5959
ignore_missing_imports = True
6060
no_implicit_optional = True
6161
warn_redundant_casts = True
62-
warn_unused_ignores = True
62+
warn_unused_ignores = False
6363
plugins =
6464
airflow.mypy.plugin.decorators
6565
pretty = True

0 commit comments

Comments
 (0)