hussein-awala commented on PR #33780: URL: https://github.com/apache/airflow/pull/33780#issuecomment-1694612098
> I would be very cautions with this pre-commit validations, because it need to handle a lot of stuff the nice example is pydantic which use annotations in runtime , and put them under if TYPE_CHECKING block might lead serious problem @Taragolis Recently ruff community implemented `flake8-type-checking` in ruff, and I would say that it cover all your concerns. There is a config to define the models we want to exempt from being moved into type-checking blocks. For x, this is commonly used: ``` [tool.ruff.flake8-type-checking] runtime-evaluated-base-classes = ["pydantic.BaseModel", "sqlalchemy.orm.DeclarativeBase"] ``` I will open a PR to add the pre-commit hook soon, and I will mention you to discuss its configuration. For this PR (and the others), I will re-check if we have a similar case, and there is an option to keep standard modules without moving if it blocks merging them, but I don't think we need to exclude them. -- 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]
