Taragolis commented on code in PR #37718:
URL: https://github.com/apache/airflow/pull/37718#discussion_r1503041125


##########
airflow/providers/openlineage/extractors/base.py:
##########
@@ -78,7 +78,9 @@ def _is_operator_disabled(self) -> bool:
         return fully_qualified_class_name in self.disabled_operators
 
     def validate(self):
-        assert self.operator.task_type in self.get_operator_classnames()
+        if self.operator.task_type not in self.get_operator_classnames():
+            msg = f"Operator Type {self.operator.task_type} is not supported."
+            raise AssertionError(msg)

Review Comment:
   I can't find usage of this method 🤔 so maybe here better to use some other 
error?



##########
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:
   I'm not 100% sure that this check uses for only make `mypy` happier
   
   @vincbeck WDYT is it possible that role Admin not existed? And we probably 
should raise actual error here, e.g. `LookupError` or something similar



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