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/21 15:53:46 UTC

[GitHub] [airflow] potiuk opened a new pull request #21020: Fix last remaining MyPy errors

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


   Closes: #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] uranusjr edited a comment on pull request #21020: Fix last remaining MyPy errors

Posted by GitBox <gi...@apache.org>.
uranusjr edited a comment on pull request #21020:
URL: https://github.com/apache/airflow/pull/21020#issuecomment-1020887285


   ~~Those two are easy, use `get_dag` instead.~~ Oh, those are already fixed in #20945 (my myself lol), so we should be good now!


-- 
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 #21020: Fix last remaining MyPy errors

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


   All right @uranusjr . Decorators are all yours:
   
   ```
   No need to rebuild the image: none of the important files changed
   
   airflow/models/dag.py:91: error: Module "airflow.decorators" has no attribute
   "TaskDecoratorFactory"; maybe "_TaskDecoratorFactory" or "TaskDecorator"? 
   [attr-defined]
           from airflow.decorators import TaskDecoratorFactory
           ^
   airflow/models/dag.py:2118: error: Argument 1 to "partial" has incompatible
   type "_TaskDecoratorFactory"; expected "Callable[..., Any]"  [arg-type]
       ...return cast("TaskDecoratorFactory", functools.partial(task, dag=self))
                                                                ^
   airflow/models/dag.py:2118: note: "_TaskDecoratorFactory.__call__" has type "staticmethod"
   Found 2 errors in 1 file (checked 2704 source files)
   
   ERROR: The previous step completed with error. Please take a look at output above 
   
   
   No need to rebuild the image: none of the important files changed
   
   airflow/example_dags/tutorial_taskflow_api_etl.py:25: error: Module
   "airflow.decorators" has no attribute "dag"  [attr-defined]
       from airflow.decorators import dag, task
       ^
   Found 1 error in 1 file (checked 403 source files)
   
   ERROR: The previous step completed with error. Please take a look at output above 
   ``` 
   
   


-- 
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 #21020: Fix last remaining MyPy errors

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


   


-- 
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 #21020: Fix last remaining MyPy errors

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



##########
File path: tests/www/api/experimental/test_dag_runs_endpoint.py
##########
@@ -97,12 +97,8 @@ def test_get_dag_runs_success_with_state_no_result(self):
         # Create DagRun
         trigger_dag(dag_id=dag_id, run_id='test_get_dag_runs_success')
 
-        response = self.app.get(url_template.format(dag_id))
-        assert 200 == response.status_code
-        data = json.loads(response.data.decode('utf-8'))
-
-        assert isinstance(data, list)
-        assert len(data) == 0
+        with pytest.raises(ValueError):

Review comment:
       I have a slight doubt about this one. This is "technically" breaking change with the experimental API, but one that shold be very welcomed by any user. So I am tempted to leave it like that (I would treat it as a bugfix).




-- 
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 pull request #21020: Fix last remaining MyPy errors

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


   Those two are easy, use `get_dag` instead.


-- 
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 #21020: Fix last remaining MyPy errors

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


   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 pull request #21020: Fix last remaining MyPy errors

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


   Any help appreciated @uranusjr @ashb :D


-- 
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 #21020: Fix last remaining MyPy errors

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



##########
File path: airflow/decorators/__init__.pyi
##########
@@ -22,11 +22,14 @@
 
 from typing import Any, Callable, Dict, Iterable, List, Mapping, Optional, TypeVar, Union, overload
 
-__all__ = ["task"]
+from airflow.models.dag import dag

Review comment:
       This was added to solve:
   
   ```
   airflow/example_dags/tutorial_taskflow_api_etl.py:25: error: Module
   "airflow.decorators" has no attribute "dag"  [attr-defined]
       from airflow.decorators import dag, task
       ^
   ```




-- 
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 #21020: Fix last remaining MyPy errors

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


   Right - rebased and fixed last two errors: @uranusjr @ashb - I fixed two small thing (not even errors but inconsistencies and MyPy complaints in the new `Operator` Interface - I am not sure if adding "owner" to interface is a good idea - I think think we do not need to add dag though (as get_dag() shoudl return it anyway):
   
   The errors were:
   
   ```
   airflow/models/base.py:67: error: "Operator" has no attribute "dag" 
   [attr-defined]
                   return self.dag.dag_id
                          ^
   airflow/models/base.py:68: error: "Operator" has no attribute "owner" 
   [attr-defined]
               return f"adhoc_{self.owner}"
   
   
   ```
   


-- 
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 #21020: Fix last remaining MyPy errors

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


   


-- 
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] ashb commented on a change in pull request #21020: Fix last remaining MyPy errors

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



##########
File path: tests/www/api/experimental/test_dag_runs_endpoint.py
##########
@@ -97,12 +97,8 @@ def test_get_dag_runs_success_with_state_no_result(self):
         # Create DagRun
         trigger_dag(dag_id=dag_id, run_id='test_get_dag_runs_success')
 
-        response = self.app.get(url_template.format(dag_id))
-        assert 200 == response.status_code
-        data = json.loads(response.data.decode('utf-8'))
-
-        assert isinstance(data, list)
-        assert len(data) == 0
+        with pytest.raises(ValueError):

Review comment:
       What bit throws the value error here? (It's not clear to from just looking at the code)
   
   Oh, that `state=dummy` results in a ValueError -- wouldn't that result in a 500 returned, when instead it should be a 400?

##########
File path: airflow/models/dagrun.py
##########
@@ -511,8 +511,12 @@ def update_state(
             finished_tasks = info.finished_tasks
             unfinished_tasks = info.unfinished_tasks
 
-            none_depends_on_past = all(not t.task.depends_on_past for t in unfinished_tasks)
-            none_task_concurrency = all(t.task.max_active_tis_per_dag is None for t in unfinished_tasks)
+            none_depends_on_past = all(
+                not t.task.depends_on_past for t in unfinished_tasks  # type: ignore[has-type]

Review comment:
       I'm surprised this needs type ignoring.

##########
File path: airflow/models/dagrun.py
##########
@@ -511,8 +511,12 @@ def update_state(
             finished_tasks = info.finished_tasks
             unfinished_tasks = info.unfinished_tasks
 
-            none_depends_on_past = all(not t.task.depends_on_past for t in unfinished_tasks)
-            none_task_concurrency = all(t.task.max_active_tis_per_dag is None for t in unfinished_tasks)
+            none_depends_on_past = all(
+                not t.task.depends_on_past for t in unfinished_tasks  # type: ignore[has-type]

Review comment:
       Oh, `t.task` could be None as far as typing is concenred?




-- 
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 edited a comment on pull request #21020: Fix last remaining MyPy errors

Posted by GitBox <gi...@apache.org>.
potiuk edited a comment on pull request #21020:
URL: https://github.com/apache/airflow/pull/21020#issuecomment-1018766716


   @uranusjr  - removed it. Let's do it this way - since I also want to re-enable mypy and we should wait a few days with some "older PRs" to get "no-rebase" warning, I will continue rebasing that one until it gets "green". So feel free to unentangle the "decorators" disaster in the meantime


-- 
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] ashb commented on a change in pull request #21020: Fix last remaining MyPy errors

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



##########
File path: airflow/models/dagrun.py
##########
@@ -511,8 +511,12 @@ def update_state(
             finished_tasks = info.finished_tasks
             unfinished_tasks = info.unfinished_tasks
 
-            none_depends_on_past = all(not t.task.depends_on_past for t in unfinished_tasks)
-            none_task_concurrency = all(t.task.max_active_tis_per_dag is None for t in unfinished_tasks)
+            none_depends_on_past = all(
+                not t.task.depends_on_past for t in unfinished_tasks  # type: ignore[has-type]

Review comment:
       I'm surprised this needs type ignoring.




-- 
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 #21020: Fix last remaining MyPy errors

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


   Seems like this one will also be a collaborative effort eventually, There are a few errors around "airflow.models.decorators" package which I am not entirely sure why they are there and whether I made the right fix.
   
   The one remaining  - after I think I solved all other is 
   
   ```
   airflow/models/dag.py:2118: error: Argument 1 to "partial" has incompatible
   type "_TaskDecoratorFactory"; expected "Callable[..., Any]"  [arg-type]
       ...return cast("TaskDecoratorFactory", functools.partial(task, dag=self))
                                                                ^
   airflow/models/dag.py:2118: note: "_TaskDecoratorFactory.__call__" has type "staticmethod"
   Found 1 error in 1 file (checked 2704 source files)
   
   ERROR: The previous step completed with error. Please take a look at output above 
   
   ```
   
   But I am not sure if the fixes are added are good. Seems like `mypy` sometimes uses the stub and sometimes not and I have no idea why.
   
   
   
   


-- 
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 #21020: Fix last remaining MyPy errors

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


   Ehh. so you will be the last one :) 


-- 
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 #21020: Fix last remaining MyPy errors

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



##########
File path: tests/www/api/experimental/test_dag_runs_endpoint.py
##########
@@ -97,12 +97,8 @@ def test_get_dag_runs_success_with_state_no_result(self):
         # Create DagRun
         trigger_dag(dag_id=dag_id, run_id='test_get_dag_runs_success')
 
-        response = self.app.get(url_template.format(dag_id))
-        assert 200 == response.status_code
-        data = json.loads(response.data.decode('utf-8'))
-
-        assert isinstance(data, list)
-        assert len(data) == 0
+        with pytest.raises(ValueError):

Review comment:
       I have a slight doubt about this one. This is "technically" breaking change with the experimental API, but one that should be very welcomed by any user. So I am tempted to leave it like that (I would treat it as a bugfix).




-- 
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 pull request #21020: Fix last remaining MyPy errors

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


   The naming and structuring of `airflow/decorators/__init__.py` is a small disaster. Let’s leave it out of this PR, I can fix them separately and perhaps try to improve the situation a bit.


-- 
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 edited a comment on pull request #21020: Fix last remaining MyPy errors

Posted by GitBox <gi...@apache.org>.
uranusjr edited a comment on pull request #21020:
URL: https://github.com/apache/airflow/pull/21020#issuecomment-1020887285


   ~~Those two are easy, use `get_dag` instead.~~ Oh, those are already fixed in #20945 (my myself lol), so we should be good now!


-- 
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 pull request #21020: Fix last remaining MyPy errors

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


   Those two are easy, use `get_dag` instead.


-- 
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] ashb commented on a change in pull request #21020: Fix last remaining MyPy errors

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



##########
File path: airflow/models/dagrun.py
##########
@@ -511,8 +511,12 @@ def update_state(
             finished_tasks = info.finished_tasks
             unfinished_tasks = info.unfinished_tasks
 
-            none_depends_on_past = all(not t.task.depends_on_past for t in unfinished_tasks)
-            none_task_concurrency = all(t.task.max_active_tis_per_dag is None for t in unfinished_tasks)
+            none_depends_on_past = all(
+                not t.task.depends_on_past for t in unfinished_tasks  # type: ignore[has-type]

Review comment:
       Oh, `t.task` could be None as far as typing is concenred?




-- 
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] ashb commented on a change in pull request #21020: Fix last remaining MyPy errors

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



##########
File path: tests/www/api/experimental/test_dag_runs_endpoint.py
##########
@@ -97,12 +97,8 @@ def test_get_dag_runs_success_with_state_no_result(self):
         # Create DagRun
         trigger_dag(dag_id=dag_id, run_id='test_get_dag_runs_success')
 
-        response = self.app.get(url_template.format(dag_id))
-        assert 200 == response.status_code
-        data = json.loads(response.data.decode('utf-8'))
-
-        assert isinstance(data, list)
-        assert len(data) == 0
+        with pytest.raises(ValueError):

Review comment:
       What bit throws the value error here? (It's not clear to from just looking at the code)
   
   Oh, that `state=dummy` results in a ValueError -- wouldn't that result in a 500 returned, when instead it should be a 400?




-- 
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 #21020: Fix last remaining MyPy errors

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


   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 pull request #21020: Fix last remaining MyPy errors

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


   Right - rebased and fixed last two errors: @uranusjr @ashb - I fixed two small thing (not even errors but inconsistencies and MyPy complaints in the new `Operator` Interface - I am not sure if adding "owner" to interface is a good idea - I think think we do not need to add dag though (as get_dag() shoudl return it anyway):
   
   The errors were:
   
   ```
   airflow/models/base.py:67: error: "Operator" has no attribute "dag" 
   [attr-defined]
                   return self.dag.dag_id
                          ^
   airflow/models/base.py:68: error: "Operator" has no attribute "owner" 
   [attr-defined]
               return f"adhoc_{self.owner}"
   
   
   ```
   


-- 
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 #21020: Fix last remaining MyPy errors

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



##########
File path: airflow/decorators/__init__.py
##########
@@ -44,3 +45,7 @@ def __getattr__(self, name: str) -> TaskDecorator:
 
 
 task = _TaskDecoratorFactory()
+
+
+if TYPE_CHECKING:
+    TaskDecoratorFactory = _TaskDecoratorFactory

Review comment:
       This was added as part of resolving those errors: 
   
   ```
   airflow/models/dag.py:91: error: Module "airflow.decorators" has no attribute
   "TaskDecoratorFactory"; maybe "_TaskDecoratorFactory" or "TaskDecorator"? 
   [attr-defined]
           from airflow.decorators import TaskDecoratorFactory
           ^
   ```




-- 
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 #21020: Fix last remaining MyPy errors

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


   @uranusjr  - remove it. Let's do it this way - since I also want to re-enable mypy and we should wait a few days with some "older PRs" to get "no-rebase" warning, I will continue rebasing that one until it gets "green". So feel free to unentangle the "decorators" disaster in the meantime


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