potiuk commented on PR #59817: URL: https://github.com/apache/airflow/pull/59817#issuecomment-3693400316
Should not we use "compat" also for type checking? I think not having compat will make mypy and other typing checks confused if our users will use mypy for checking their dags - we had a number of issues in the past from our users when they had some problems with it. As far as I understand how MyPy and other type checkers work, is that they actually parse even installed packages - so if someone installs our provider and runs mypy checks on their code using that provider, the `if TYPE_CHECKING` branch will be triggered, and if they do it in Airflow 2 - that will yield "unknown import" - which at the worst case will trigger typing check error that they will have to # type: ignore, at the best case the inference for those types won't work and their mypy checks are not going to be as useful. So for me - the decision to not use compat for TYPE_CHECKING branches has some negative effects for Airlfow 2 users - and I don't see what we are going to gain by doing it (We will have to anyhow convert those into sdk imports in bulk when we go to apache-airflow>=3.1.0 state for providers. -- 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]
