Dev-iL commented on issue #43176: URL: https://github.com/apache/airflow/issues/43176#issuecomment-2676691843
@zach-overflow > * All `dag_id`'s should be unique (AKA prevent name collisions and detect them at validation time). I'm not sure Ruff supports multi-file checks, so I suspect this might only be applicable to situations where multiple DAGs are defined in a single script. IIRC this can be detected by a [DagBag unit test](https://airflow.apache.org/docs/apache-airflow/stable/best-practices.html#unit-tests). > * 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)). I think this too belongs in the realm of checks to be added to `DagBag` and/or unit tests. > * Optionally check whether DAG definitions are serializable or not Could you please elaborate (mainly out of curiosity): - What common pattern might make a DAG definition non-serializable? - In what contexts does this matter? - Is this supposed to be a static or a DagBag-related test? If static - how can this be done without trying to serialize the DAG and seeing if it works? -------- All in all I these are some good ideas to be included in `DagBag`, some variation of DagBag that's used for DAG validation, or at the very least - unit test examples to be added to the docs. -- 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]
