Skip to content

Commit

Permalink
Disables --warn-unused-ignore flag for mypy (#10880)
Browse files Browse the repository at this point in the history
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.

GitOrigin-RevId: d93c1fdb26aba280d907ef431bae6c9984155a9c
  • Loading branch information
potiuk authored and Cloud Composer Team committed Dec 7, 2022
1 parent 96ba460 commit 10a5b56
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion airflow/models/dagrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class DagRun(Base, LoggingMixin):

task_instances = relationship(
TI,
primaryjoin=and_(TI.dag_id == dag_id, TI.execution_date == execution_date),
primaryjoin=and_(TI.dag_id == dag_id, TI.execution_date == execution_date), # type: ignore
foreign_keys=(dag_id, execution_date),
backref=backref('dag_run', uselist=False),
)
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ packages = airflow
ignore_missing_imports = True
no_implicit_optional = True
warn_redundant_casts = True
warn_unused_ignores = True
warn_unused_ignores = False
plugins =
airflow.mypy.plugin.decorators
pretty = True
Expand Down

0 comments on commit 10a5b56

Please sign in to comment.