pierrejeambrun commented on code in PR #44208:
URL: https://github.com/apache/airflow/pull/44208#discussion_r1850571291


##########
airflow/api_fastapi/common/db/common.py:
##########
@@ -47,8 +49,29 @@ def your_route(session: Annotated[Session, 
Depends(get_session)]):
         yield session
 
 
-def apply_filters_to_select(base_select: Select, filters: Sequence[BaseParam | 
None]) -> Select:
+async def get_async_session() -> Session:

Review Comment:
   I think there is an AsyncSession type or something similar. 



##########
airflow/api_fastapi/common/db/common.py:
##########
@@ -47,8 +49,29 @@ def your_route(session: Annotated[Session, 
Depends(get_session)]):
         yield session
 
 
-def apply_filters_to_select(base_select: Select, filters: Sequence[BaseParam | 
None]) -> Select:
+async def get_async_session() -> Session:
+    """
+    Dependency for providing a session.
+
+    For non route function please use the 
:class:`airflow.utils.session.provide_session` decorator.
+
+    Example usage:
+
+    .. code:: python
+
+        @router.get("/your_path")
+        def your_route(session: Annotated[Session, Depends(get_session)]):

Review Comment:
   ```suggestion
           def your_route(session: Annotated[Session, 
Depends(get_async_session)]):
   ```



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