You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Taragolis (via GitHub)" <gi...@apache.org> on 2024/05/06 12:42:29 UTC
Re: [PR] Use `back_populates` instead of `sqlalchemy.orm.backref` in bidirectional relationships [airflow]
Taragolis commented on code in PR #39430:
URL: https://github.com/apache/airflow/pull/39430#discussion_r1590962541
##########
airflow/models/dag.py:
##########
@@ -4108,15 +4121,6 @@ def factory(*args, **kwargs):
return wrapper
-STATICA_HACK = True
-globals()["kcah_acitats"[::-1].upper()] = False
-if STATICA_HACK: # pragma: no cover
- from airflow.models.serialized_dag import SerializedDagModel
-
- DagModel.serialized_dag = relationship(SerializedDagModel)
- """:sphinx-autoapi-skip:"""
-
-
Review Comment:
Remove this lines, which are hack for the almost the same behaviour as TYPE_CHEKING will make `mypy` unhappy
```console
❯ mypy airflow/__init__.py
airflow/__init__.py:125: error: Cannot determine type of
"initialize_providers_list" [has-type]
manager.initialize_providers_list()
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
airflow/__init__.py:126: error: Cannot determine type of
"initialize_providers_hooks" [has-type]
manager.initialize_providers_hooks()
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
airflow/__init__.py:127: error: Cannot determine type of
"initialize_providers_extra_links" [has-type]
manager.initialize_providers_extra_links()
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
For unknown (for me) reason this lines somehow breaks `mypy` checks, and as result it ignored some issues with methods decorated by
https://github.com/apache/airflow/blob/79286d6398e8e964a467de7f1e9fc10520bba00a/airflow/providers_manager.py#L365
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org