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/19 04:03:58 UTC

[GitHub] [airflow] subkanthi opened a new pull request #20404: Fix mypy errors in airflow/operators

subkanthi opened a new pull request #20404:
URL: https://github.com/apache/airflow/pull/20404


   related: #19891 
   Fixes mypy errors in airflow/operators
   
   airflow/operators/python.py:179: error: Incompatible types in assignment (expression has type "Mapping[str, Any]", variable has type "Dict[Any, Any]")
               self.op_kwargs = determine_kwargs(self.python_callable, self.op_args, context)
                                ^
   airflow/operators/bash.py:146: error: Incompatible default for argument "cwd" (default has type "None", argument has type "str")
               cwd: str = None,
                          ^
   airflow/operators/trigger_dagrun.py:173: error: Item "None" of "Optional[DagRun]" has no attribute "execution_date"
               ti.xcom_push(key=XCOM_EXECUTION_DATE_ISO, value=dag_run.execution_date.isoformat())
                                                               ^
   airflow/operators/trigger_dagrun.py:174: error: Item "None" of "Optional[DagRun]" has no attribute "run_id"
               ti.xcom_push(key=XCOM_RUN_ID, value=dag_run.run_id)
                                                   ^
   airflow/operators/trigger_dagrun.py:182: error: Item "None" of "Optional[DagRun]" has no attribute "execution_date"
                           dag_run.execution_date,
                           ^
   airflow/operators/trigger_dagrun.py:187: error: Item "None" of "Optional[DagRun]" has no attribute "refresh_from_db"
                       dag_run.refresh_from_db()
                       ^
   airflow/operators/trigger_dagrun.py:188: error: Item "None" of "Optional[DagRun]" has no attribute "state"
                       state = dag_run.state
   <!--
   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] subkanthi commented on a change in pull request #20404: Fix mypy errors in airflow/operators

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



##########
File path: airflow/operators/trigger_dagrun.py
##########
@@ -167,6 +167,9 @@ def execute(self, context: Dict):
             else:
                 raise e
 
+        if not dag_run:

Review comment:
       Need to validate if this is OK to do




-- 
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 #20404: Fix mypy errors in airflow/operators

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


   


-- 
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 #20404: Fix mypy errors in airflow/operators

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


   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



[GitHub] [airflow] potiuk commented on a change in pull request #20404: Fix mypy errors in airflow/operators

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



##########
File path: airflow/operators/trigger_dagrun.py
##########
@@ -167,6 +167,9 @@ def execute(self, context: Dict):
             else:
                 raise e
 
+        if not dag_run:

Review comment:
       I believe  it's good, though error message could be more descriptive. "Could not find dag_run to trigger" ?.  What do others think ?




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