diff --git a/providers/fab/src/airflow/providers/fab/auth_manager/models/__init__.py b/providers/fab/src/airflow/providers/fab/auth_manager/models/__init__.py index 375a8a6d9526b..1acc7568040b6 100644 --- a/providers/fab/src/airflow/providers/fab/auth_manager/models/__init__.py +++ b/providers/fab/src/airflow/providers/fab/auth_manager/models/__init__.py @@ -21,8 +21,6 @@ # This product contains a modified portion of 'Flask App Builder' developed by Daniel Vaz Gaspar. # (https://github.com/dpgaspar/Flask-AppBuilder). # Copyright 2013, Daniel Vaz Gaspar -from typing import TYPE_CHECKING - from flask import current_app, g from flask_appbuilder import Model from sqlalchemy import ( @@ -45,12 +43,6 @@ from airflow.api_fastapi.auth.managers.models.base_user import BaseUser from airflow.providers.common.compat.sqlalchemy.orm import mapped_column -if TYPE_CHECKING: - try: - from sqlalchemy import Identity - except Exception: - Identity = None - """ Compatibility note: The models in this file are duplicated from Flask AppBuilder. """ diff --git a/providers/fab/tests/unit/fab/auth_manager/models/test_user_model.py b/providers/fab/tests/unit/fab/auth_manager/models/test_user_model.py index 051e39cd0530d..ba549e9b55e0d 100644 --- a/providers/fab/tests/unit/fab/auth_manager/models/test_user_model.py +++ b/providers/fab/tests/unit/fab/auth_manager/models/test_user_model.py @@ -25,12 +25,9 @@ @pytest.mark.parametrize( "user_id, expected_id", - [ - (999, "999"), - ("999", "999"), - ], + [(999, "999")], ) -def test_get_id_returns_str(user_id: int | str, expected_id: str) -> None: +def test_get_id_returns_str(user_id: int, expected_id: str) -> None: """ Ensure get_id() always returns a string representation of the id. """