potiuk commented on code in PR #37718:
URL: https://github.com/apache/airflow/pull/37718#discussion_r1503188217
##########
airflow/providers/fab/auth_manager/security_manager/override.py:
##########
@@ -728,7 +728,8 @@ def create_admin_standalone(self) -> tuple[str | None, str
| None]:
if not user_exists:
print(f"FlaskAppBuilder Authentication Manager: Creating
{user_name} user")
role = self.find_role("Admin")
- assert role is not None
+ if TYPE_CHECKING:
+ assert role is not None
Review Comment:
We had a discussion about it and the `if TYPE_CHECKING: assert` was the only
one that we decided to "Allow". But I am also for completely getting rid of it
especially if we can add ruff rule to take care about it. There is very little
benefit of using assert instead of something `if-y` here (like raising
exception expliditly here is "good enough" for me if the trade-off is we will
get "don't use assert" automated and future proof.
--
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]