bugraoz93 commented on code in PR #44332:
URL: https://github.com/apache/airflow/pull/44332#discussion_r1870419878


##########
tests/api_fastapi/core_api/routes/ui/test_grid.py:
##########
@@ -0,0 +1,414 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+from __future__ import annotations
+
+from datetime import timedelta
+
+import pendulum
+import pytest
+
+from airflow.decorators import task_group
+from airflow.models import DagBag
+from airflow.operators.empty import EmptyOperator
+from airflow.utils import timezone
+from airflow.utils.session import provide_session
+from airflow.utils.state import DagRunState, TaskInstanceState
+from airflow.utils.task_group import TaskGroup
+from airflow.utils.types import DagRunType
+
+from tests_common.test_utils.compat import AIRFLOW_V_3_0_PLUS
+from tests_common.test_utils.db import clear_db_assets, clear_db_dags, 
clear_db_runs, clear_db_serialized_dags
+from tests_common.test_utils.mock_operators import MockOperator
+
+if AIRFLOW_V_3_0_PLUS:
+    from airflow.utils.types import DagRunTriggeredByType
+
+pytestmark = pytest.mark.db_test
+
+DAG_ID = "test_dag"
+DAG_ID_2 = "test_dag_2"
+TASK_ID = "task"
+TASK_ID_2 = "task2"
+
+
+@pytest.fixture(autouse=True, scope="module")
+def examples_dag_bag():
+    # Speed up: We don't want example dags for this module
+    return DagBag(include_examples=False, read_dags_from_db=True)
+
+
+@pytest.fixture(autouse=True)
+@provide_session
+def setup(dag_maker, session=None):
+    clear_db_runs()
+    clear_db_dags()
+    clear_db_serialized_dags()
+
+    with dag_maker(dag_id=DAG_ID, serialized=True, session=session) as dag:
+        EmptyOperator(task_id=TASK_ID)
+
+        @task_group
+        def mapped_task_group(arg1):
+            return MockOperator(task_id="subtask", arg1=arg1)
+
+        mapped_task_group.expand(arg1=["a", "b", "c"])
+        with TaskGroup(group_id="task_group"):
+            MockOperator.partial(task_id="mapped_task").expand(arg1=["a", "b", 
"c", "d"])
+
+    triggered_by_kwargs = {"triggered_by": DagRunTriggeredByType.TEST} if 
AIRFLOW_V_3_0_PLUS else {}
+    logical_date = timezone.datetime(2024, 11, 30)

Review Comment:
   Indeed, I missed it while including a fix for the caplog. Removed



-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to