henry3260 commented on code in PR #61647:
URL: https://github.com/apache/airflow/pull/61647#discussion_r2799889669
##########
providers/fab/src/airflow/providers/fab/auth_manager/fab_auth_manager.py:
##########
@@ -198,11 +198,15 @@ def get_cli_commands() -> list[CLICommand]:
def get_fastapi_app(self) -> FastAPI | None:
"""Get the FastAPI app."""
- from airflow.providers.fab.auth_manager.api_fastapi.routes.login
import (
- login_router,
+ from airflow.providers.fab.auth_manager.api_fastapi.routes import (
+ login as _login, # noqa: F401
+ roles as _roles, # noqa: F401
+ users as _users, # noqa: F401
+ )
Review Comment:
> But you do not use these imports, do you?
Yeah, that's correct - we don't use these imports directly. They're imported
purely for their side effects (registering routes to the routers).
The underscore prefix is just a convention to indicate:
1. These are intentionally unused imports
2. They exist only for side effects
I don't have a strong preference about keeping the underscore naming.
If you prefer `login`, `roles`, `users` without the underscore, that works
too :)
--
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]