omkar-foss commented on code in PR #42848:
URL: https://github.com/apache/airflow/pull/42848#discussion_r1793991208


##########
tests/api_fastapi/views/public/test_dags.py:
##########
@@ -302,3 +302,51 @@ def test_dag_details(test_client, query_params, dag_id, 
expected_status_code, da
         "timezone": UTC_JSON_REPR,
     }
     assert res_json == expected
+
+
[email protected](
+    "query_params, dag_id, expected_status_code, dag_display_name",
+    [
+        ({}, "fake_dag_id", 404, "fake_dag"),
+        ({}, DAG2_ID, 200, DAG2_DISPLAY_NAME),
+    ],
+)
+def test_dag(test_client, query_params, dag_id, expected_status_code, 
dag_display_name):
+    response = test_client.get(f"/public/dags/{dag_id}", params=query_params)
+    assert response.status_code == expected_status_code
+    if expected_status_code != 200:
+        return
+
+    # Match expected and actual responses below.
+    res_json = response.json()
+    last_parsed_time = res_json["last_parsed_time"]
+    file_token = res_json["file_token"]
+    expected = {
+        "dag_id": dag_id,
+        "dag_display_name": dag_display_name,
+        "description": None,
+        "fileloc": "/opt/airflow/tests/api_fastapi/views/public/test_dags.py",
+        "file_token": file_token,
+        "is_paused": False,
+        "is_active": True,
+        "owners": ["airflow"],
+        "timetable_summary": None,
+        "tags": [],
+        "next_dagrun": None,
+        "has_task_concurrency_limits": True,
+        "next_dagrun_data_interval_start": None,
+        "next_dagrun_data_interval_end": None,
+        "max_active_runs": 16,
+        "max_consecutive_failed_dag_runs": 0,
+        "next_dagrun_create_after": None,
+        "last_expired": None,
+        "max_active_tasks": 16,
+        "last_pickled": None,
+        "default_view": "grid",
+        "last_parsed_time": last_parsed_time,
+        "scheduler_lock": None,
+        "timetable_description": "Never, external triggers only",
+        "has_import_errors": False,
+        "pickle_id": None,

Review Comment:
   Hey I checked further and it doesn't look like PRs 
https://github.com/apache/airflow/pull/41390 and 
https://github.com/apache/airflow/pull/41453 are a part of the v2.10.2 release 
for which the legacy API docs (stable) are available 
[here](https://airflow.apache.org/docs/apache-airflow/stable/stable-rest-api-ref.html).
   
   I suppose we can include both these PRs in v2.11 so the API docs remain 
consistent for old and new APIs. Or if v2.11 being a bridge release won't have 
our new APIs then we won't have to do anything as v3 will include both these 
PRs anyway.
   
   Please let me know your thoughts on this, thanks!



-- 
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]

Reply via email to