bolkedebruin commented on code in PR #53690:
URL: https://github.com/apache/airflow/pull/53690#discussion_r2227692975
##########
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:
What fails exactly?
numpy1:
```python
>>> import numpy as np
>>> x = np.bool_(1)
>>> if hasattr(np, "bool") and isinstance(x, np.bool) or isinstance(x,
np.bool_):
... print("Yes")
<python-input-6>:1: FutureWarning: In the future `np.bool` will be defined
as the corresponding NumPy scalar.
Yes
```
(Slow connection here).
Update: a sorry images where loading slow. I think it is fine to have
exception in the test case with a proper comment. Ideally with a test case that
does cover this specifically.
--
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]