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 2022/04/29 17:17:33 UTC

[GitHub] [airflow] mik-laj commented on a diff in pull request #23359: Validate DAG owner to be a string.

mik-laj commented on code in PR #23359:
URL: https://github.com/apache/airflow/pull/23359#discussion_r861997869


##########
tests/cluster_policies/__init__.py:
##########
@@ -27,6 +27,9 @@
 
 # [START example_cluster_policy_rule]
 def task_must_have_owners(task: BaseOperator):
+    if task.owner and not isinstance(task.owner, str):
+        raise AirflowClusterPolicyViolation(f'''owner should be a string. Current value: {task.owner}''')

Review Comment:
   ```suggestion
           raise AirflowClusterPolicyViolation(f'''owner should be a string. Current value: {task.owner!r}''')
   ```



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