uranusjr commented on code in PR #53690:
URL: https://github.com/apache/airflow/pull/53690#discussion_r2238150545


##########
airflow-core/src/airflow/serialization/serializers/numpy.py:
##########
@@ -69,7 +70,7 @@ def serialize(o: object) -> tuple[U, str, int, bool]:
     ):
         return int(o), name, __version__, True
 
-    if isinstance(o, np.bool_):
+    if hasattr(np, "bool") and isinstance(o, np.bool) or isinstance(o, 
np.bool_):

Review Comment:
   Why not avoid checking `bool` altogether if `bool_` is available instead?
   
   ```python
   if (np_bool := getattr(np, "bool_", None) or np.bool) and isinstance(o, 
np_bool)
   ```



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