zach-overflow commented on issue #43176:
URL: https://github.com/apache/airflow/issues/43176#issuecomment-2669919039
Some additional best practices rule suggestions:
* All `dag_id`'s should be unique (AKA prevent name collisions and detect
them at validation time).
* +1 to @Dev-iL's suggestion on top-level code, specifically I can think of
two preliminary checks for that category:
1. Ensure function-level imports are used in DAG files when possible
(again, an example of this kind of rule may be found in the airflint repo
[here](https://github.com/feluelle/airflint/blob/main/airflint/rules/use_function_level_imports.py#L11))
2. Require Variables passed to operator constructors are only passed as
Jinja templates (per the official best practice section
[here](https://airflow.apache.org/docs/apache-airflow/stable/best-practices.html#airflow-variables)).
* Lastly -- and this might be a larger scope suggestion -- it would be
_really_ useful if the Airflow linter could validate the user's DAG code
against any user-defined task policy or dag policy (as defined in their
[cluster
policy](https://airflow.apache.org/docs/apache-airflow/stable/administration-and-deployment/cluster-policies.html#cluster-policies)).
--
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]