sjyangkevin commented on issue #52753: URL: https://github.com/apache/airflow/issues/52753#issuecomment-3111740351
> > > Or maybe even'isinstance(o, bool)' could work as np's bool is just an alias to the builtin bool? > > > > > > If that's the case in both numpy's then that's probably best :D > > Unfotunately, I misread that. So in numpy < 1.24.0 `np.bool` (note the missing _) was an alias. `np.bool_` was a numpy scalar. In numpy 2 `np.bool` has become a numpy scalar. > > `(hasattr(np, "bool") and isinstance(o, np.bool) or isinstance(o, np.bool_)` > > Will work though. I've created a draft PR and hope it can help in reviewing the code. I attempted to implement the proposed change and attached the test outcomes in the PR. I feel we might need to update the failing test case, or still need the version check in the numpy serializer to import the right bool, but would like to hear your feedback. Thanks. -- 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: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org