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

DatabricksPlugin - Fix dag view redirect URL by using url_for redirect #41040

Merged
Merged
Changes from 1 commit
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
8 changes: 3 additions & 5 deletions airflow/providers/databricks/plugins/databricks_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
from flask_appbuilder.api import expose
from packaging.version import Version

from airflow.configuration import conf
from airflow.exceptions import AirflowException, TaskInstanceNotFound
from airflow.models import BaseOperator, BaseOperatorLink
from airflow.models.dag import DAG, clear_task_instances
Expand Down Expand Up @@ -413,8 +412,7 @@ class RepairDatabricksTasks(AirflowBaseView, LoggingMixin):
@expose("/repair_databricks_job/<string:dag_id>/<string:run_id>", methods=("GET",))
@get_auth_decorator()
def repair(self, dag_id: str, run_id: str):
view = conf.get("webserver", "dag_default_view")
return_url = self._get_return_url(dag_id, view)
return_url = self._get_return_url(dag_id, run_id)

tasks_to_repair = request.values.get("tasks_to_repair")
self.log.info("Tasks to repair: %s", tasks_to_repair)
Expand Down Expand Up @@ -450,8 +448,8 @@ def repair(self, dag_id: str, run_id: str):
return redirect(return_url)

@staticmethod
def _get_return_url(dag_id: str, view) -> str:
return f"/dags/{dag_id}/{view}"
def _get_return_url(dag_id: str, run_id: str) -> str:
return url_for("Airflow.grid", dag_id=dag_id, dag_run_id=run_id)
pankajkoti marked this conversation as resolved.
Show resolved Hide resolved


repair_databricks_view = RepairDatabricksTasks()
Expand Down
Loading