From 8c25b2343997f1e14f433d419512dc425232c3b3 Mon Sep 17 00:00:00 2001 From: anand Date: Mon, 1 Apr 2024 10:00:59 -0500 Subject: [PATCH] precommit fixes --- astronomer_starship/compat/starship_hook.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/astronomer_starship/compat/starship_hook.py b/astronomer_starship/compat/starship_hook.py index 10ac5f2..0b58694 100644 --- a/astronomer_starship/compat/starship_hook.py +++ b/astronomer_starship/compat/starship_hook.py @@ -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 @@ -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" @@ -153,7 +154,6 @@ def set_dag_state( class StarshipDagRunMigrationHook(BaseHook): - def __init__( self, source_webserver_url: str, @@ -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(