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 2021/12/01 01:09:53 UTC

[GitHub] [airflow] potiuk opened a new pull request #19911: Fix mypy checks for api_connexion

potiuk opened a new pull request #19911:
URL: https://github.com/apache/airflow/pull/19911


   Part of #19891
   
   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of existing issue, reference it using one of the following:
   
   closes: #ISSUE
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   
   ---
   **^ Add meaningful description above**
   
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
   In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/main/UPDATING.md).
   


-- 
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] potiuk commented on a change in pull request #19911: Fix mypy checks for api_connexion

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



##########
File path: airflow/api_connexion/schemas/dag_schema.py
##########
@@ -86,7 +86,7 @@ class DAGDetailSchema(DAGSchema):
     doc_md = fields.String()
     default_view = fields.String()
     params = fields.Method('get_params', dump_only=True)
-    tags = fields.Method("get_tags", dump_only=True)
+    tags = fields.Method("get_tags", dump_only=True)  # type: ignore

Review comment:
       Good one for `type: ignore` then




-- 
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 #19911: Fix mypy checks for api_connexion

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


   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] potiuk commented on a change in pull request #19911: Fix mypy checks for api_connexion

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



##########
File path: airflow/api_connexion/schemas/dag_schema.py
##########
@@ -86,7 +86,7 @@ class DAGDetailSchema(DAGSchema):
     doc_md = fields.String()
     default_view = fields.String()
     params = fields.Method('get_params', dump_only=True)
-    tags = fields.Method("get_tags", dump_only=True)
+    tags = fields.Method("get_tags", dump_only=True)  # type: ignore

Review comment:
       @mik-laj @ephraimbuddy - > I am not sure if this is a "real" bug or this assignment is valid here: 
   
   The error here is:
   
   ```
   airflow/api_connexion/schemas/dag_schema.py:89: error: Incompatible types in
   assignment (expression has type "Method", base class "DAGSchema" defined the
   type as "marshmallow.fields.List")
           tags = fields.Method("get_tags", dump_only=True)
   ```
   




-- 
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] kaxil commented on a change in pull request #19911: Fix mypy checks for api_connexion

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



##########
File path: airflow/api_connexion/endpoints/dag_endpoint.py
##########
@@ -111,15 +110,15 @@ def patch_dag(session, dag_id, update_mask=None):
 
 @security.requires_access([(permissions.ACTION_CAN_DELETE, permissions.RESOURCE_DAG)])
 @provide_session
-def delete_dag(dag_id: str, session: Session):
+def delete_dag(dag_id: str, session):

Review comment:
       Isn't this change the same as just `type: ignore` -- we should keep the `Session` or just ignore it for now so we can identifying the pending changes




-- 
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] potiuk commented on a change in pull request #19911: Fix mypy checks for api_connexion

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



##########
File path: airflow/api_connexion/endpoints/dag_endpoint.py
##########
@@ -111,15 +110,15 @@ def patch_dag(session, dag_id, update_mask=None):
 
 @security.requires_access([(permissions.ACTION_CAN_DELETE, permissions.RESOURCE_DAG)])
 @provide_session
-def delete_dag(dag_id: str, session: Session):
+def delete_dag(dag_id: str, session):

Review comment:
       Yeah. Switching to the new method by @uranusjr :)




-- 
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] potiuk merged pull request #19911: Fix mypy checks for api_connexion

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


   


-- 
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] potiuk commented on pull request #19911: Fix mypy checks for api_connexion

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #19911:
URL: https://github.com/apache/airflow/pull/19911#issuecomment-983187634


   cc: @josh-fell 


-- 
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] kaxil commented on a change in pull request #19911: Fix mypy checks for api_connexion

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



##########
File path: airflow/api_connexion/schemas/dag_schema.py
##########
@@ -86,7 +86,7 @@ class DAGDetailSchema(DAGSchema):
     doc_md = fields.String()
     default_view = fields.String()
     params = fields.Method('get_params', dump_only=True)
-    tags = fields.Method("get_tags", dump_only=True)
+    tags = fields.Method("get_tags", dump_only=True)  # type: ignore

Review comment:
       cc @uranusjr 




-- 
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 #19911: Fix mypy checks for api_connexion

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



##########
File path: airflow/api_connexion/schemas/dag_schema.py
##########
@@ -86,7 +86,7 @@ class DAGDetailSchema(DAGSchema):
     doc_md = fields.String()
     default_view = fields.String()
     params = fields.Method('get_params', dump_only=True)
-    tags = fields.Method("get_tags", dump_only=True)
+    tags = fields.Method("get_tags", dump_only=True)  # type: ignore

Review comment:
       I think it's not a bug. We did it because the DAGDetailsSchema is not a database schema but object schema and there was no way we could extract the tags in that case




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