bingqin2 commented on PR #72906: URL: https://github.com/apache/airflow/pull/72906#issuecomment-5666373636
Thanks, added. `task-sdk/tests/task_sdk/definitions/test_dag.py` now covers the two helpers directly, without the database (`DagModel.get_current` is patched, since Task SDK tests must not use one): - `_static_trigger_targets`: literal ids are collected and the Dag's own id ignored, a Dag without trigger tasks yields an empty set, and a templated value, an XComArg, or a mapped operator expanding over `trigger_dag_id` make the result `None` (a mapped operator with a fixed `trigger_dag_id` in `partial()` is still static) - `_dag_test_files_to_sync`: the Dag's own file alone, target files resolved through `relative_fileloc` or the absolute `fileloc` with targets from another bundle skipped, and every whole-bundle fallback: the Dag defined outside the bundle, a non-static target, a target never parsed, a target without a recorded location, and a target file missing or resolving outside the bundle The operator used is a small `BaseOperator` subclass with a `trigger_dag_id` template field, so the suite does not depend on the standard provider. The airflow-core tests stay as the end-to-end check of `DAG.test()` itself, which needs the bundle and the metadata DB. -- 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]
