You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2023/01/03 21:28:46 UTC

[GitHub] [airflow] surabathini commented on a diff in pull request #28097: logging poke info when external dag is not none and task_id and task_ids are none

surabathini commented on code in PR #28097:
URL: https://github.com/apache/airflow/pull/28097#discussion_r1060969692


##########
airflow/sensors/external_task.py:
##########
@@ -140,21 +140,30 @@ def __init__(
                 f"`{self.allowed_states}` and failed states `{self.failed_states}`"
             )
 
-        if external_task_id is not None and external_task_ids is not None:
+        if external_task_id and external_task_ids:
             raise ValueError(
                 "Only one of `external_task_id` or `external_task_ids` may "
-                "be provided to ExternalTaskSensor; not both."
+                "be provided to ExternalTaskSensor; "
+                "Use external_task_id or external_task_ids or external_task_group_id."
             )
 
-        if external_task_id is not None:
-            external_task_ids = [external_task_id]
+        if external_task_group_id and external_task_id:
+            raise ValueError(
+                "Only one of `external_task_group_id` or `external_task_id` may "
+                "be provided to ExternalTaskSensor; "
+                "Use external_task_id or external_task_ids or external_task_group_id."
+            )
 
         if external_task_group_id and external_task_ids:
             raise ValueError(
-                "Values for `external_task_group_id` and `external_task_id` or `external_task_ids` "
-                "can't be set at the same time"
+                "Only one of `external_task_group_id` or `external_task_ids` may "
+                "be provided to ExternalTaskSensor; "
+                "Use external_task_id or external_task_ids or external_task_group_id."
             )

Review Comment:
   No specific reason other than keeping all the conditions look same in this function. some are with out is not none and some are with is not none.
   Are there any potential issues you foresee with this change?



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org