shashbha14 commented on code in PR #65661:
URL: https://github.com/apache/airflow/pull/65661#discussion_r3155431586
##########
airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_extra_links.py:
##########
@@ -284,6 +297,16 @@ def test_should_respond_200_mapped_task_instance(self,
test_client, session):
).model_dump()
)
+ @pytest.mark.mock_plugin_manager(plugins=[TryNumberPlugin])
+ def test_should_use_try_number_when_specified(self, test_client):
+ """When try_number param is passed, it overrides ti.try_number for
link generation."""
+ response = test_client.get(
+
f"/dags/{self.dag_id}/dagRuns/{self.dag_run_id}/taskInstances/{self.task_single_link}/links",
+ params={"try_number": 3},
+ )
+ assert response.status_code == 200
+ assert response.json()["extra_links"]["Try Number"] ==
"https://example.com/logs?try_number=3"
Review Comment:
Verified — since we now fetch 'TaskInstanceHistory' directly instead of
modifying the live 'TaskInstance', the TI in the DB is never touched. The
'try_number' on the DB record remains unchanged.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]