guan404ming commented on code in PR #61833:
URL: https://github.com/apache/airflow/pull/61833#discussion_r2815344531
##########
task-sdk/src/airflow/sdk/definitions/dag.py:
##########
@@ -590,6 +610,29 @@ def _validate_tags(self, _, tags: Collection[str]):
if tags and any(len(tag) > TAG_MAX_LEN for tag in tags):
raise ValueError(f"tag cannot be longer than {TAG_MAX_LEN}
characters")
+ @allowed_run_types.validator
+ def _validate_allowed_run_types(self, _, allowed_run_types):
+ if not allowed_run_types:
+ return
+ from airflow.utils.types import DagRunType
Review Comment:
Good suggestion. However the existing code in this file already imports
`DagRunType` from `airflow.utils.types` (line 1222), so this is consistent with
the current pattern. Also, the two `DagRunType` enums have different member
names (`BACKFILL_JOB` vs `BACKFILL`), so switching would need some care. Maybe
better addressed as a separate cleanup across the file. What do you think?
--
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]