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/01/17 09:53:36 UTC

[GitHub] [airflow] uranusjr opened a new pull request #20900: Quelch deprecation warning in basic auth tests

uranusjr opened a new pull request #20900:
URL: https://github.com/apache/airflow/pull/20900


   Re-submitting #20742 with conflicts removed. Most significantly, `mark_tasks` is modified to not use bare execution dates, but AIP-39 data intervals.


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



[GitHub] [airflow] ephraimbuddy commented on a change in pull request #20900: Quelch deprecation warning in tests

Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on a change in pull request #20900:
URL: https://github.com/apache/airflow/pull/20900#discussion_r786643456



##########
File path: airflow/api_connexion/schemas/dag_schema.py
##########
@@ -79,7 +79,7 @@ class DAGDetailSchema(DAGSchema):
     timezone = TimezoneField()
     catchup = fields.Boolean()
     orientation = fields.String()
-    concurrency = fields.Integer()  # TODO: Remove in Airflow 3.0
+    concurrency = fields.Method("get_concurrency")  # TODO: Remove in Airflow 3.0

Review comment:
       Ok. 
   You mean that in `get_concurrency` limit, if we use `obj.max_active_tasks` instead of `obj.max_active_runs`  it'll cause a problem? 




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



[GitHub] [airflow] uranusjr commented on a change in pull request #20900: Quelch deprecation warning in tests

Posted by GitBox <gi...@apache.org>.
uranusjr commented on a change in pull request #20900:
URL: https://github.com/apache/airflow/pull/20900#discussion_r786569517



##########
File path: airflow/api_connexion/endpoints/role_and_permission_endpoint.py
##########
@@ -147,7 +147,7 @@ def post_role() -> APIResponse:
     if not role:
         perms = [(item['action']['name'], item['resource']['name']) for item in data['permissions'] if item]
         _check_action_and_resource(security_manager, perms)
-        security_manager.init_role(role_name=data['name'], perms=perms)
+        security_manager.bulk_sync_roles([{"role": data["name"], "perms": perms}])

Review comment:
       `init_role()` is deprecated (and simply calls `bulk_sync_roles`), this removes one 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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

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



[GitHub] [airflow] ephraimbuddy commented on a change in pull request #20900: Quelch deprecation warning in tests

Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on a change in pull request #20900:
URL: https://github.com/apache/airflow/pull/20900#discussion_r786475358



##########
File path: airflow/api_connexion/endpoints/role_and_permission_endpoint.py
##########
@@ -147,7 +147,7 @@ def post_role() -> APIResponse:
     if not role:
         perms = [(item['action']['name'], item['resource']['name']) for item in data['permissions'] if item]
         _check_action_and_resource(security_manager, perms)
-        security_manager.init_role(role_name=data['name'], perms=perms)
+        security_manager.bulk_sync_roles([{"role": data["name"], "perms": perms}])

Review comment:
       Seems unrelated?




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



[GitHub] [airflow] github-actions[bot] commented on pull request #20900: Quelch deprecation warning in tests

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #20900:
URL: https://github.com/apache/airflow/pull/20900#issuecomment-1015325787


   The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest main or amend the last commit of the PR, and push it with --force-with-lease.


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



[GitHub] [airflow] uranusjr commented on a change in pull request #20900: Quelch deprecation warning in tests

Posted by GitBox <gi...@apache.org>.
uranusjr commented on a change in pull request #20900:
URL: https://github.com/apache/airflow/pull/20900#discussion_r786650603



##########
File path: airflow/api_connexion/schemas/dag_schema.py
##########
@@ -79,7 +79,7 @@ class DAGDetailSchema(DAGSchema):
     timezone = TimezoneField()
     catchup = fields.Boolean()
     orientation = fields.String()
-    concurrency = fields.Integer()  # TODO: Remove in Airflow 3.0
+    concurrency = fields.Method("get_concurrency")  # TODO: Remove in Airflow 3.0

Review comment:
       Oh… no, I meant if we use `concurrency = fields.Integer("max_active_tasks")` it’ll error. The `max_active_runs` below is a typo 🤦 

##########
File path: airflow/api_connexion/schemas/dag_schema.py
##########
@@ -90,6 +90,10 @@ class DAGDetailSchema(DAGSchema):
     is_paused = fields.Method("get_is_paused", dump_only=True)
     is_active = fields.Method("get_is_active", dump_only=True)
 
+    @staticmethod
+    def get_concurrency(obj: DAG):
+        return obj.max_active_runs

Review comment:
       ```suggestion
           return obj.max_active_tasks
   ```




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



[GitHub] [airflow] uranusjr commented on a change in pull request #20900: Quelch deprecation warning in tests

Posted by GitBox <gi...@apache.org>.
uranusjr commented on a change in pull request #20900:
URL: https://github.com/apache/airflow/pull/20900#discussion_r786572217



##########
File path: airflow/api_connexion/schemas/dag_schema.py
##########
@@ -79,7 +79,7 @@ class DAGDetailSchema(DAGSchema):
     timezone = TimezoneField()
     catchup = fields.Boolean()
     orientation = fields.String()
-    concurrency = fields.Integer()  # TODO: Remove in Airflow 3.0
+    concurrency = fields.Method("get_concurrency")  # TODO: Remove in Airflow 3.0

Review comment:
       Yeah that’s the point. `concurrency = fields.Integer()` triggers Marshmallow to access the deprecated `concurrency` property and emits a deprecation warning, and this change instead accesses `max_active_tasks` to avoid it. The additional `get_concurrency` method is added because Marshmallow is too smart to detect that `max_active_tasks` is already declared on the schema (right below this line) and throws an exception if we also directly access the same attribute for this field.




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



[GitHub] [airflow] uranusjr commented on a change in pull request #20900: Quelch deprecation warning in tests

Posted by GitBox <gi...@apache.org>.
uranusjr commented on a change in pull request #20900:
URL: https://github.com/apache/airflow/pull/20900#discussion_r786652654



##########
File path: airflow/api_connexion/schemas/dag_schema.py
##########
@@ -79,7 +79,7 @@ class DAGDetailSchema(DAGSchema):
     timezone = TimezoneField()
     catchup = fields.Boolean()
     orientation = fields.String()
-    concurrency = fields.Integer()  # TODO: Remove in Airflow 3.0
+    concurrency = fields.Method("get_concurrency")  # TODO: Remove in Airflow 3.0

Review comment:
       fixed




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



[GitHub] [airflow] ephraimbuddy commented on a change in pull request #20900: Quelch deprecation warning in tests

Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on a change in pull request #20900:
URL: https://github.com/apache/airflow/pull/20900#discussion_r786476750



##########
File path: airflow/api_connexion/schemas/dag_schema.py
##########
@@ -79,7 +79,7 @@ class DAGDetailSchema(DAGSchema):
     timezone = TimezoneField()
     catchup = fields.Boolean()
     orientation = fields.String()
-    concurrency = fields.Integer()  # TODO: Remove in Airflow 3.0
+    concurrency = fields.Method("get_concurrency")  # TODO: Remove in Airflow 3.0

Review comment:
       The concurrency here is the same as `max_active_tasks` but deprecated. See https://github.com/apache/airflow/blob/fce46e603b742087a4b72aad42b3126b9c262aa1/airflow/models/dag.py#L388-L396




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



[GitHub] [airflow] uranusjr merged pull request #20900: Quelch deprecation warning in tests

Posted by GitBox <gi...@apache.org>.
uranusjr merged pull request #20900:
URL: https://github.com/apache/airflow/pull/20900


   


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