Skip to content

Commit

Permalink
precommit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
astro-anand committed Apr 1, 2024
1 parent 25a7088 commit 8c25b23
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions astronomer_starship/compat/starship_hook.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
from typing import Literal
from logging import getLogger
import requests
from requests.adapters import HTTPAdapter
from typing import Literal
from textwrap import dedent
from urllib3.util.retry import Retry
from urllib.parse import urljoin

from airflow.utils.state import DagRunState
from airflow.hooks.base import BaseHook

Expand Down Expand Up @@ -42,7 +44,6 @@ def _request(


class StarshipAPIHook(BaseHook):

DAG_RUNS = "/api/starship/dag_runs"
TASK_INSTANCES = "/api/starship/task_instances"
DAGS = "/api/starship/dags"
Expand Down Expand Up @@ -153,7 +154,6 @@ def set_dag_state(


class StarshipDagRunMigrationHook(BaseHook):

def __init__(
self,
source_webserver_url: str,
Expand Down Expand Up @@ -184,7 +184,10 @@ def load_dagruns_to_target(
state = self.source_api_hook.get_latest_dagrun_state(dag_id=dag_id)
if state not in (DagRunState.FAILED, DagRunState.SUCCESS):
logger.info(
f"Latest dagrun for {dag_id} is not not in state {(DagRunState.FAILED, DagRunState.SUCCESS)}. Skipping migration."
dedent(
f"""Latest dagrun for {dag_id} is not not in state
{(DagRunState.FAILED, DagRunState.SUCCESS)}. Skipping migration."""
)
)
else:
self.source_api_hook.set_dag_state(
Expand Down

0 comments on commit 8c25b23

Please sign in to comment.