pierrejeambrun commented on code in PR #43675:
URL: https://github.com/apache/airflow/pull/43675#discussion_r1846174979
##########
tests/api_fastapi/core_api/routes/public/test_task_instances.py:
##########
@@ -1127,3 +1128,174 @@ def test_should_respond_dependencies_mapped(self,
test_client, session):
"print_the_context/0/dependencies",
)
assert response.status_code == 200, response.text
+
+
+class TestGetTaskInstanceTry(TestTaskInstanceEndpoint):
+ def test_should_respond_200(self, test_client, session):
+ self.create_task_instances(session, task_instances=[{"state":
State.SUCCESS}], with_ti_history=True)
+ response = test_client.get(
+
"/public/dags/example_python_operator/dagRuns/TEST_DAG_RUN_ID/taskInstances/print_the_context/tries/1"
+ )
+ assert response.status_code == 200
+ assert response.json() == {
+ "dag_id": "example_python_operator",
+ "duration": 10000.0,
+ "end_date": "2020-01-03T00:00:00Z",
+ "executor": None,
+ "executor_config": "{}",
+ "hostname": "",
+ "map_index": -1,
+ "max_tries": 0,
+ "operator": "PythonOperator",
+ "pid": 100,
+ "pool": "default_pool",
+ "pool_slots": 1,
+ "priority_weight": 9,
+ "queue": "default_queue",
+ "queued_when": None,
+ "start_date": "2020-01-02T00:00:00Z",
+ "state": "success",
+ "task_id": "print_the_context",
+ "task_display_name": "print_the_context",
+ "try_number": 1,
+ "unixname": getuser(),
+ "dag_run_id": "TEST_DAG_RUN_ID",
+ }
+
Review Comment:
Oh, that's a different endpoint for mapped task, got it.
--
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]