Skip to content
Closed
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
2 changes: 1 addition & 1 deletion task-sdk/src/airflow/sdk/execution_time/task_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ def get_log_url_from_ti(ti: RuntimeTaskInstance) -> str:
try_number = (
f"?try_number={try_number_value}" if try_number_value is not None and try_number_value > 0 else ""
)
_log_uri = f"{base_url}dags/{ti.dag_id}/runs/{run_id}/tasks/{ti.task_id}{map_index}{try_number}"
_log_uri = f"{base_url}/dags/{ti.dag_id}/runs/{run_id}/tasks/{ti.task_id}{map_index}{try_number}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the default value, it may make sense but for user supplied values, we should ideally do:

if not base_url.endswith("/"):
    base_url += "/"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please also add a test in task-sdk/tests/task_sdk/execution_time/test_task_runner.py?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rstrip and always add slash could be another approach.

task-sdk/src/airflow/sdk/execution_time/execute_workload.py:    default_execution_api_server = f"{base_url.rstrip('/')}/execution/"
airflow-core/src/airflow/executors/local_executor.py:    default_execution_api_server = f"{base_url.rstrip('/')}/execution/"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That can be done too. @jessicaschueler can we make those changes?

return _log_uri


Expand Down
Loading