shahar1 commented on code in PR #75379:
URL: https://github.com/apache/airflow/pull/75379#discussion_r4426391725
##########
task-sdk/src/airflow/sdk/definitions/dag.py:
##########
@@ -220,14 +222,14 @@ def _convert_access_control(access_control):
def _convert_allowed_run_types(
- val: DagRunType | Collection[DagRunType] | None,
+ val: DagRunType | str | Collection[DagRunType | str] | None,
) -> frozenset[DagRunType] | None:
"""Convert allowed_run_types parameter to a frozenset of DagRunType
values."""
if val is None:
return None
from airflow.sdk.api.datamodels._generated import DagRunType
Review Comment:
nit: one behaviour does change here. Today `allowed_run_types=""` iterates
to an empty frozenset, the validator returns early on a falsy value and the
serializer writes `None`, so it means "no restriction". With this change it
becomes `[""]` and raises `ValueError: '' is not a valid DagRunType`. Raising
is probably the better outcome, but it contradicts "nothing that works today
breaks" in the description and differs from `tags=""`, which keeps producing an
empty set. Either note it in the description, or treat a falsy value like
`None` here for consistency with `_convert_tags`.
--
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]