Skip to content

Commit

Permalink
Fix mypy checks for api_connexion
Browse files Browse the repository at this point in the history
Part of apache#19891
  • Loading branch information
potiuk committed Dec 1, 2021
1 parent 2539cb4 commit 3a1426b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions airflow/api_connexion/endpoints/dag_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
from airflow.exceptions import AirflowException, DagNotFound
from airflow.models.dag import DagModel, DagTag
from airflow.security import permissions
from airflow.settings import Session
from airflow.utils.session import provide_session


Expand Down Expand Up @@ -111,15 +110,15 @@ def patch_dag(session, dag_id, update_mask=None):

@security.requires_access([(permissions.ACTION_CAN_DELETE, permissions.RESOURCE_DAG)])
@provide_session
def delete_dag(dag_id: str, session: Session):
def delete_dag(dag_id: str, session):
"""Delete the specific DAG."""
# TODO: This function is shared with the /delete endpoint used by the web
# UI, so we're reusing it to simplify maintenance. Refactor the function to
# another place when the experimental/legacy API is removed.
from airflow.api.common.experimental import delete_dag
from airflow.api.common.experimental import delete_dag as delete_dag_module

try:
delete_dag.delete_dag(dag_id, session=session)
delete_dag_module.delete_dag(dag_id, session=session)
except DagNotFound:
raise NotFound(f"Dag with id: '{dag_id}' not found")
except AirflowException:
Expand Down
2 changes: 1 addition & 1 deletion airflow/api_connexion/schemas/dag_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class DAGDetailSchema(DAGSchema):
doc_md = fields.String()
default_view = fields.String()
params = fields.Method('get_params', dump_only=True)
tags = fields.Method("get_tags", dump_only=True)
tags = fields.Method("get_tags", dump_only=True) # type: ignore
is_paused = fields.Method("get_is_paused", dump_only=True)
is_active = fields.Method("get_is_active", dump_only=True)

Expand Down

0 comments on commit 3a1426b

Please sign in to comment.