Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix import error TaskInstance not define #1495

Merged
merged 1 commit into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
import os
import time
from datetime import datetime, timedelta
from typing import TYPE_CHECKING, Any, List
from typing import Any, List

from airflow import DAG, settings
from airflow.exceptions import AirflowException
from airflow.models import Connection, Variable
from airflow.models import Connection, TaskInstance, Variable
from airflow.operators.python import PythonOperator
from airflow.providers.amazon.aws.operators.emr import (
EmrCreateJobFlowOperator,
Expand All @@ -26,9 +26,6 @@
NamedHivePartitionSensorAsync,
)

if TYPE_CHECKING:
from airflow.models.taskinstance import TaskInstance

HIVE_CLUSTER = os.getenv("HIVE_CLUSTER", "example_hive_sensor_cluster")
AWS_S3_CREDS = {
"aws_access_key_id": os.getenv("AWS_ACCESS_KEY_ID", "aws_access_key"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
import os
import time
from datetime import datetime, timedelta
from typing import TYPE_CHECKING, Any, List
from typing import Any, List

from airflow import DAG, settings
from airflow.exceptions import AirflowException
from airflow.models import Connection, Variable
from airflow.models import Connection, TaskInstance, Variable
from airflow.operators.python import PythonOperator
from airflow.providers.amazon.aws.operators.emr import (
EmrCreateJobFlowOperator,
Expand All @@ -25,9 +25,6 @@

from astronomer.providers.apache.livy.operators.livy import LivyOperatorAsync

if TYPE_CHECKING:
from airflow.models.taskinstance import TaskInstance

LIVY_CLUSTER = os.getenv("LIVY_CLUSTER", "example_livy_operator_cluster")
BOTO_DUPLICATE_PERMISSION_ERROR = "InvalidPermission.Duplicate"
LIVY_JAVA_FILE = os.getenv("LIVY_JAVA_FILE", "/spark-examples.jar")
Expand Down
7 changes: 2 additions & 5 deletions astronomer/providers/sftp/example_dags/example_sftp.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import os
import time
from datetime import timedelta
from typing import TYPE_CHECKING, Any, List
from typing import Any, List

from airflow import DAG, AirflowException, settings
from airflow.models import Connection, Variable
from airflow.models import Connection, TaskInstance, Variable
from airflow.operators.python import PythonOperator, get_current_context
from airflow.utils.state import State
from airflow.utils.timezone import datetime
Expand All @@ -15,9 +15,6 @@

from astronomer.providers.sftp.sensors.sftp import SFTPSensorAsync

if TYPE_CHECKING:
from airflow.models import TaskInstance

SFTP_CONN_ID = os.getenv("ASTRO_SFTP_CONN_ID", "sftp_default")
EXECUTION_TIMEOUT = int(os.getenv("EXECUTION_TIMEOUT", 6))
AWS_S3_CREDS = {
Expand Down
Loading