-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Closed
Labels
affected_version:3.0Issues Reported for 3.0Issues Reported for 3.0area:corekind:bugThis is a clearly a bugThis is a clearly a bugpriority:mediumBug that should be fixed before next release but would not block a releaseBug that should be fixed before next release but would not block a release
Description
Apache Airflow version
3.0.3
If "Other Airflow 2 version" selected, which one?
No response
What happened?
The method get_log_url_from_ti of RuntimeTaskInstance contains a typo that returns an inaccessible URL.
The string is currently formatted;
_log_uri = f"{base_url}dags/{ti.dag_id}/runs/{run_id}/tasks/{ti.task_id}{map_index}{try_number}"
What you think should happen instead?
To correct this, a forward slash should be added
_log_uri = f"{base_url}/dags/{ti.dag_id}/runs/{run_id}/tasks/{ti.task_id}{map_index}{try_number}"
How to reproduce
The following dag code will print the url
from airflow.decorators import dag, task
from pendulum import datetime
@dag(
start_date=datetime(2024, 1, 1),
schedule="@daily",
catchup=False,
doc_md=__doc__,
default_args={"retries": 3},
tags=["example"],
)
def example_url():
# Define tasks
@task
def print_log_url(**context) -> None:
url = context["ti"].log_url
print(f"log_url is {url}")
print_log_url()
example_url()
The address produced returns an error
Operating System
mac 15.5 (24F74)
Versions of Apache Airflow Providers
No response
Deployment
Official Apache Airflow Helm Chart
Deployment details
No response
Anything else?
No response
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
arjunanan6
Metadata
Metadata
Assignees
Labels
affected_version:3.0Issues Reported for 3.0Issues Reported for 3.0area:corekind:bugThis is a clearly a bugThis is a clearly a bugpriority:mediumBug that should be fixed before next release but would not block a releaseBug that should be fixed before next release but would not block a release