rawwar commented on code in PR #43508:
URL: https://github.com/apache/airflow/pull/43508#discussion_r1833534268
##########
airflow/api_fastapi/core_api/routes/public/dag_run.py:
##########
@@ -99,7 +99,7 @@ async def delete_dag_run(dag_id: str, dag_run_id: str,
session: Annotated[Sessio
]
),
)
-async def patch_dag_run_state(
+async def patch_dag_run(
Review Comment:
I tried to remove `async` as per PR #43797.
But, tests are failing with the following error and I'm looking into this:
```
Traceback (most recent call last):
File "/Users/kalyan/oss/oss-airflow/airflow/utils/session.py", line 56, in
create_session
yield session
File
"/Users/kalyan/oss/oss-airflow/airflow/api_fastapi/common/db/common.py", line
47, in get_session
yield session
File
"/Users/kalyan/oss/oss-airflow/.venv/lib/python3.9/site-packages/fastapi/routing.py",
line 301, in app
raw_response = await run_endpoint_function(
File
"/Users/kalyan/oss/oss-airflow/.venv/lib/python3.9/site-packages/fastapi/routing.py",
line 214, in run_endpoint_function
return await run_in_threadpool(dependant.call, **values)
File
"/Users/kalyan/oss/oss-airflow/.venv/lib/python3.9/site-packages/starlette/concurrency.py",
line 39, in run_in_threadpool
return await anyio.to_thread.run_sync(func, *args)
File
"/Users/kalyan/oss/oss-airflow/.venv/lib/python3.9/site-packages/anyio/to_thread.py",
line 56, in run_sync
return await get_async_backend().run_sync_in_worker_thread(
File
"/Users/kalyan/oss/oss-airflow/.venv/lib/python3.9/site-packages/anyio/_backends/_asyncio.py",
line 2441, in run_sync_in_worker_thread
return await future
File
"/Users/kalyan/oss/oss-airflow/.venv/lib/python3.9/site-packages/anyio/_backends/_asyncio.py",
line 943, in run
result = context.run(func, *args)
File
"/Users/kalyan/oss/oss-airflow/airflow/api_fastapi/core_api/routes/public/dag_run.py",
line 113, in patch_dag_run
raise HTTPException(
fastapi.exceptions.HTTPException: 404: The DagRun with dag_id: `test_dag1`
and run_id: `invalid` was not found
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File
"/Users/kalyan/oss/oss-airflow/.venv/lib/python3.9/site-packages/sqlalchemy/pool/base.py",
line 763, in _finalize_fairy
fairy._reset(pool, transaction_was_reset)
File
"/Users/kalyan/oss/oss-airflow/.venv/lib/python3.9/site-packages/sqlalchemy/pool/base.py",
line 1038, in _reset
pool._dialect.do_rollback(self)
File
"/Users/kalyan/oss/oss-airflow/.venv/lib/python3.9/site-packages/sqlalchemy/engine/default.py",
line 683, in do_rollback
dbapi_connection.rollback()
sqlite3.ProgrammingError: SQLite objects created in a thread can only be
used in that same thread. The object was created in thread id 13195309056 and
this is thread id 6162526208.
```
--
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]