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/22 18:32:36 UTC

[GitHub] [airflow] potiuk opened a new pull request #20469: Fix new google mypy errors

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


   <!--
   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 pull request #20469: Fix new google mypy errors

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


   > Why are the pyi files needed? They seem to duplicate the exact same type hints in their corresponding actual .py files.
   
   It's about the default (= None). The problem is that until we properly handle 'apply_defaults' mypy complains about missing parameters in examples (where mandatory parameters are passed only by apply defaults). We had few other cases like that and while it is not perfect it works for now. 
   
   I think eventually we will need a mypy plugin to handle this case but this would require to learn more on how mypy internals work.


-- 
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 #20469: Fix new google mypy errors

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


   


-- 
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 #20469: Fix new google mypy errors

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



##########
File path: airflow/providers/google/cloud/operators/gcs.py
##########
@@ -792,7 +792,7 @@ def __init__(
         self.upload_continue_on_fail = upload_continue_on_fail
         self.upload_num_attempts = upload_num_attempts
 
-    def execute(self, context: dict) -> None:
+    def execute(self, context: dict) -> List[str]:

Review comment:
       Should we use "Context" here too?




-- 
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 #20469: Fix new google mypy errors

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


   Seems good to get 60+ less mypy errors :)


-- 
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 #20469: Fix new google mypy errors

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



##########
File path: airflow/providers/google/cloud/operators/gcs.py
##########
@@ -792,7 +792,7 @@ def __init__(
         self.upload_continue_on_fail = upload_continue_on_fail
         self.upload_num_attempts = upload_num_attempts
 
-    def execute(self, context: dict) -> None:
+    def execute(self, context: dict) -> List[str]:

Review comment:
       I planned to make a "global" change to add "Context" everywhere, but yeah - it might make sense to add/fix Context in the change - for every touched file. 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] potiuk commented on pull request #20469: Fix new google mypy errors

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


   Any more comments? Or approvals maybe :) ? 


-- 
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 #20469: Fix new google mypy errors

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


   The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, 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