potiuk commented on a change in pull request #12184:
URL: https://github.com/apache/airflow/pull/12184#discussion_r519458218
##########
File path: UPDATING.md
##########
@@ -50,6 +50,14 @@ assists users migrating to a new version.
## Airflow Master
+### Rename policy to task_policy
+
+Because Airflow introduced DAG level policy (`dag_policy`) we decided to
rename existing `policy`
+function to `task_policy` to make the distinction more profound and avoid any
confusion.
+
+Users using cluster policy need to rename their `policy` functions in
`airflow_local_settings.py`
+to `task_policy`.
+
Review comment:
I think we should deprecate it rather than remove.
##########
File path: airflow/models/dagbag.py
##########
@@ -383,8 +383,11 @@ def bag_dag(self, dag, root_dag):
dag.resolve_template_files()
dag.last_loaded = timezone.utcnow()
+ # Check policies
+ settings.dag_policy(dag)
+
for task in dag.tasks:
- settings.policy(task)
+ settings.task_policy(task)
Review comment:
Here we should check if 'policy' is defined and run it as well but with
deprecation warning.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]