rjgoyln commented on code in PR #75379:
URL: https://github.com/apache/airflow/pull/75379#discussion_r4367825604


##########
task-sdk/src/airflow/sdk/definitions/dag.py:
##########
@@ -227,7 +229,7 @@ def _convert_allowed_run_types(
         return None
     from airflow.sdk.api.datamodels._generated import DagRunType
 
-    if isinstance(val, enum.Enum):
+    if isinstance(val, str | enum.Enum):

Review Comment:
   One small typing gap: `allowed_run_types="manual"` now works at runtime, but 
mypy still rejects it because the annotations only allow `DagRunType`. Since 
`DagRunType` isn't exported from `airflow.sdk`, strings seem like the more 
natural choice for DAG authors. 
   
   Could we widen the converter signature and `dag()` overload to `DagRunType | 
str | Collection[DagRunType | str] | None`? I tested this locally, and mypy 
accepts both the single string and list forms.



-- 
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]

Reply via email to