tirkarthi commented on issue #48670:
URL: https://github.com/apache/airflow/issues/48670#issuecomment-2772759659
The PR has a test which fails locally with the issue and should have failed
in CI with the PR. I am wondering why it didn't fail in main.
```
pytest
../../../../airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_grid.py
-k test_should_response_200_with_deleted_task_and_taskgroup
====================================================================================
test session starts
=====================================================================================
platform linux -- Python 3.11.11, pytest-8.3.4, pluggy-1.5.0 --
/home/karthikeyan/stuff/python/airflow/.venv/bin/python3
cachedir: .pytest_cache
rootdir: /home/karthikeyan/stuff/python/airflow
configfile: pyproject.toml
plugins: rerunfailures-15.0, time-machine-2.16.0, unordered-0.6.1,
icdiff-0.9, kgb-7.2, xdist-3.6.1, asyncio-0.25.0, cov-6.0.0, timeouts-1.2.1,
mock-3.14.0, anyio-4.9.0, requests-mock-1.12.1, custom-exit-code-0.3.0,
instafail-0.5.0
asyncio: mode=Mode.STRICT, asyncio_default_fixture_loop_scope=function
setup timeout: 0.0s, execution timeout: 0.0s, teardown timeout: 0.0s
collected 25 items / 24 deselected / 1 selected
../../../tests/unit/api_fastapi/core_api/routes/ui/test_grid.py::TestGetGridDataEndpoint::test_should_response_200_with_deleted_task_and_taskgroup
FAILED [100%]
==========================================================================================
FAILURES
==========================================================================================
______________________________________________________
TestGetGridDataEndpoint.test_should_response_200_with_deleted_task_and_taskgroup
During handling of the above exception, another exception occurred:
../../../tests/unit/api_fastapi/core_api/routes/ui/test_grid.py:1148: in
test_should_response_200_with_deleted_task_and_taskgroup
response = test_client.get(f"/grid/{DAG_ID_3}")
../../../../.venv/lib/python3.11/site-packages/starlette/testclient.py:465:
in get
return super().get(
../../../../.venv/lib/python3.11/site-packages/httpx/_client.py:1053: in get
return self.request(
../../../../.venv/lib/python3.11/site-packages/starlette/testclient.py:437:
in request
return super().request(
../../../../.venv/lib/python3.11/site-packages/httpx/_client.py:825: in
request
return self.send(request, auth=auth, follow_redirects=follow_redirects)
../../../../.venv/lib/python3.11/site-packages/httpx/_client.py:914: in send
response = self._send_handling_auth(
../../../../.venv/lib/python3.11/site-packages/httpx/_client.py:942: in
_send_handling_auth
response = self._send_handling_redirects(
../../../../.venv/lib/python3.11/site-packages/httpx/_client.py:979: in
_send_handling_redirects
response = self._send_single_request(request)
../../../../.venv/lib/python3.11/site-packages/httpx/_client.py:1014: in
_send_single_request
response = transport.handle_request(request)
../../../../.venv/lib/python3.11/site-packages/starlette/testclient.py:340:
in handle_request
raise exc
../../../../.venv/lib/python3.11/site-packages/starlette/testclient.py:337:
in handle_request
portal.call(self.app, scope, receive, send)
../../../../.venv/lib/python3.11/site-packages/anyio/from_thread.py:290: in
call
return cast(T_Retval, self.start_task_soon(func, *args).result())
/usr/lib/python3.11/concurrent/futures/_base.py:456: in result
return self.__get_result()
/usr/lib/python3.11/concurrent/futures/_base.py:401: in __get_result
raise self._exception
../../../../.venv/lib/python3.11/site-packages/anyio/from_thread.py:221: in
_call_func
retval = await retval_or_awaitable
../../../../.venv/lib/python3.11/site-packages/fastapi/applications.py:1054:
in __call__
await super().__call__(scope, receive, send)
../../../../.venv/lib/python3.11/site-packages/starlette/applications.py:112:
in __call__
await self.middleware_stack(scope, receive, send)
../../../../.venv/lib/python3.11/site-packages/starlette/middleware/errors.py:187:
in __call__
raise exc
../../../../.venv/lib/python3.11/site-packages/starlette/middleware/errors.py:165:
in __call__
await self.app(scope, receive, _send)
../../../../.venv/lib/python3.11/site-packages/starlette/middleware/gzip.py:29:
in __call__
await responder(scope, receive, send)
../../../../.venv/lib/python3.11/site-packages/starlette/middleware/gzip.py:126:
in __call__
await super().__call__(scope, receive, send)
../../../../.venv/lib/python3.11/site-packages/starlette/middleware/gzip.py:46:
in __call__
await self.app(scope, receive, self.send_with_compression)
../../../../.venv/lib/python3.11/site-packages/starlette/middleware/cors.py:85:
in __call__
await self.app(scope, receive, send)
../../../../.venv/lib/python3.11/site-packages/starlette/middleware/base.py:173:
in __call__
with recv_stream, send_stream, collapse_excgroups():
/usr/lib/python3.11/contextlib.py:158: in __exit__
self.gen.throw(typ, value, traceback)
../../../../.venv/lib/python3.11/site-packages/starlette/_utils.py:82: in
collapse_excgroups
raise exc
../../../../.venv/lib/python3.11/site-packages/starlette/middleware/base.py:175:
in __call__
response = await self.dispatch_func(request, call_next)
../api_fastapi/core_api/middleware.py:28: in dispatch
response = await call_next(request)
../../../../.venv/lib/python3.11/site-packages/starlette/middleware/base.py:153:
in call_next
raise app_exc
../../../../.venv/lib/python3.11/site-packages/starlette/middleware/base.py:140:
in coro
await self.app(scope, receive_or_disconnect, send_no_error)
../../../../.venv/lib/python3.11/site-packages/starlette/middleware/exceptions.py:62:
in __call__
await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
../../../../.venv/lib/python3.11/site-packages/starlette/_exception_handler.py:53:
in wrapped_app
raise exc
../../../../.venv/lib/python3.11/site-packages/starlette/_exception_handler.py:42:
in wrapped_app
await app(scope, receive, sender)
../../../../.venv/lib/python3.11/site-packages/starlette/routing.py:714: in
__call__
await self.middleware_stack(scope, receive, send)
../../../../.venv/lib/python3.11/site-packages/starlette/routing.py:734: in
app
await route.handle(scope, receive, send)
../../../../.venv/lib/python3.11/site-packages/starlette/routing.py:288: in
handle
await self.app(scope, receive, send)
../../../../.venv/lib/python3.11/site-packages/starlette/routing.py:76: in
app
await wrap_app_handling_exceptions(app, request)(scope, receive, send)
../../../../.venv/lib/python3.11/site-packages/starlette/_exception_handler.py:53:
in wrapped_app
raise exc
../../../../.venv/lib/python3.11/site-packages/starlette/_exception_handler.py:42:
in wrapped_app
await app(scope, receive, sender)
../../../../.venv/lib/python3.11/site-packages/starlette/routing.py:73: in
app
response = await f(request)
../../../../.venv/lib/python3.11/site-packages/fastapi/routing.py:301: in app
raw_response = await run_endpoint_function(
../../../../.venv/lib/python3.11/site-packages/fastapi/routing.py:214: in
run_endpoint_function
return await run_in_threadpool(dependant.call, **values)
../../../../.venv/lib/python3.11/site-packages/starlette/concurrency.py:37:
in run_in_threadpool
return await anyio.to_thread.run_sync(func)
../../../../.venv/lib/python3.11/site-packages/anyio/to_thread.py:56: in
run_sync
return await get_async_backend().run_sync_in_worker_thread(
../../../../.venv/lib/python3.11/site-packages/anyio/_backends/_asyncio.py:2470:
in run_sync_in_worker_thread
return await future
../../../../.venv/lib/python3.11/site-packages/anyio/_backends/_asyncio.py:967:
in run
result = context.run(func, *args)
../api_fastapi/core_api/routes/ui/grid.py:171: in grid_data
parent_task_id=task_node_map[ti.task_id]["parent_id"],
task_node_map=task_node_map
E KeyError: 'task4'
-----------------------------------------------------------------------------------
Captured stdout setup
------------------------------------------------------------------------------------
========================= AIRFLOW ==========================
Home of the user: /home/karthikeyan
Airflow home /home/karthikeyan/airflow
Skipping initializing of the DB as it was initialized already.
You can re-initialize the database by adding --with-db-init flag when
running tests.
[2024-12-31T05:30:00.000+0530] {dagbag.py:575} INFO - Filling up the DagBag
from /dev/null
[2024-12-31T05:30:00.000+0530] {collection.py:81} INFO - Creating ORM DAG
for test_dag
[2024-12-31T05:30:00.000+0530] {collection.py:81} INFO - Creating ORM DAG
for test_dag_2
[2024-12-31T05:30:00.000+0530] {collection.py:81} INFO - Creating ORM DAG
for test_dag_3
-------------------------------------------------------------------------------------
Captured log setup
-------------------------------------------------------------------------------------
INFO airflow.models.dagbag.DagBag:dagbag.py:575 Filling up the DagBag
from /dev/null
INFO airflow.dag_processing.collection:collection.py:81 Creating ORM DAG
for test_dag
INFO airflow.dag_processing.collection:collection.py:81 Creating ORM DAG
for test_dag_2
INFO airflow.dag_processing.collection:collection.py:81 Creating ORM DAG
for test_dag_3
============================================================================
Warning summary. Total: 3, Unique: 3
============================================================================
other: total 3, unique 3
runtest: total 3, unique 3
Warnings saved into
/home/karthikeyan/stuff/python/airflow/.venv/lib/python3.11/warnings.txt file.
==================================================================================
short test summary info
===================================================================================
FAILED
../../../tests/unit/api_fastapi/core_api/routes/ui/test_grid.py::TestGetGridDataEndpoint::test_should_response_200_with_deleted_task_and_taskgroup
- KeyError: 'task4'
======================================================================== 1
failed, 24 deselected, 1 warning in 2.97s
=========================================================================
```
--
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]