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/06 02:48:35 UTC
[GitHub] [airflow] josh-fell commented on a change in pull request #20654: Fix MyPy Errors for providers: Tableau, CNCF, Apache
josh-fell commented on a change in pull request #20654:
URL: https://github.com/apache/airflow/pull/20654#discussion_r779265091
##########
File path: airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py
##########
@@ -56,14 +44,21 @@
)
from airflow.providers.cncf.kubernetes.backcompat.pod_runtime_info_env import PodRuntimeInfoEnv
from airflow.providers.cncf.kubernetes.utils import xcom_sidecar
+from airflow.providers.cncf.kubernetes.utils.pod_manager import PodLaunchFailedException, PodManager, PodPhase
+from airflow.settings import pod_mutation_hook
+from airflow.utils import yaml
+from airflow.utils.context import Context
Review comment:
Need to add this when `TYPE_CHECKING` otherwise the Kubernetes provider will have a minimum Airflow-version dependency on 2.2.3.
##########
File path: airflow/providers/tableau/operators/tableau_refresh_workbook.py
##########
@@ -15,14 +15,11 @@
# specific language governing permissions and limitations
# under the License.
import warnings
-from typing import TYPE_CHECKING, Optional
+from typing import Optional
from airflow.models import BaseOperator
from airflow.providers.tableau.operators.tableau import TableauOperator
-
-if TYPE_CHECKING:
- from airflow.utils.context import Context
-
+from airflow.utils.context import Context
Review comment:
Needs to be in `TYPE_CHECKING` or handled a different way so that the Tableau provider doesn't have a minimum Airflow version requirement of 2.2.3.
##########
File path: airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py
##########
@@ -307,7 +302,7 @@ def __init__(
def _render_nested_template_fields(
self,
content: Any,
- context: Dict,
+ context: Context,
Review comment:
After adding to `TYPE_CHECKING`:
```suggestion
context: "Context",
```
--
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