Skip to content

Conversation

@jessicaschueler
Copy link

Add forward slash in front of dags to get_log_url_from_ti method to return usable URL.

Closes #54247

@boring-cyborg
Copy link

boring-cyborg bot commented Aug 7, 2025

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our pre-commits will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

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?

@kaxil
Copy link
Member

kaxil commented Aug 13, 2025

@AlexisNeiraSonos
Copy link

Thank you @mandeepzemo @eladkal for your quick response! I’ll keep an eye on the next release!

Add forward slash in front of `dags` to `get_log_url_from_ti` method to return usable URL.
@kaxil kaxil modified the milestones: Airflow 3.0.7, Airflow 3.1.0 Sep 13, 2025
kaxil added a commit to astronomer/airflow that referenced this pull request Sep 15, 2025
The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
@kaxil kaxil removed this from the Airflow 3.1.0 milestone Sep 15, 2025
kaxil added a commit to astronomer/airflow that referenced this pull request Sep 15, 2025
The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
@kaxil kaxil closed this in 3e16382 Sep 15, 2025
kaxil added a commit that referenced this pull request Sep 15, 2025
The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes #54247
Closes #54248
Closes #53884

(cherry picked from commit 3e16382)
kaxil added a commit that referenced this pull request Sep 15, 2025
The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes #54247
Closes #54248
Closes #53884

(cherry picked from commit 3e16382)
yash1thsa pushed a commit to yash1thsa/airflow that referenced this pull request Sep 16, 2025
…5699)

The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
suman-himanshu pushed a commit to suman-himanshu/airflow that referenced this pull request Sep 17, 2025
…5699)

The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Sep 30, 2025
…5699)

The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 1, 2025
…5699)

The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 2, 2025
…5699)

The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 3, 2025
…5699)

The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 4, 2025
…5699)

The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 5, 2025
…5699)

The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 5, 2025
…5699)

The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 7, 2025
…5699)

The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 8, 2025
…5699)

The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 9, 2025
…5699)

The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 10, 2025
…5699)

The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 11, 2025
…5699)

The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 12, 2025
…5699)

The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 14, 2025
…5699)

The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 15, 2025
…5699)

The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 17, 2025
…5699)

The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 19, 2025
…5699)

The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Oct 24, 2025
The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes #54247
Closes apache/airflow#54248
Closes apache/airflow#53884

(cherry picked from commit 3e1638250fb8f58a399ad8c5946dbb77a079f63d)

GitOrigin-RevId: 09560358e062f238e89018dc45dba44fb382b747
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

context["ti"].log_url returns unuseable value

6 participants