sjyangkevin opened a new pull request, #53690: URL: https://github.com/apache/airflow/pull/53690
Create this PR to help review the solution for #52753 ### Unit Test the testing ran in the breeze environment with numpy `1.26.4` installed. The following test case failed because it attempted to import `numpy.bool`. `np.bool` was a deprecated alias for the built-in Python `bool` type, introduced in NumPy version `1.20.0`. `np.bool_` is the Numpy scalar. If we keep both `"numpy.bool"` and `"numpy.bool_"` in the list of serializers and the list of deserializers, we might need to update this test case to run based on the installed numpy version. Or, update the code to check which numpy version we have and import and check the right bool (https://github.com/apache/airflow/issues/52753#issuecomment-3107668476). ``` breeze testing core-tests --test-type Serialization ``` <img width="1286" height="927" alt="Screenshot from 2025-07-23 21-36-12" src="https://github.com/user-attachments/assets/985eefab-d796-49ce-a86d-d9a2356844b7" /> <img width="1255" height="221" alt="Screenshot from 2025-07-23 21-36-38" src="https://github.com/user-attachments/assets/3b8d3e6f-dc4c-416e-ab8f-fb1e359c0f5b" /> then, I created a init file `files/airflow-breeze-config/init.sh` to run `uv pip install --upgrade pandas`. This upgrade both pandas and numpy to the following versions. We may not only update one package, because the pandas depends on the numpy package and can result in the error mentioned https://github.com/apache/airflow/issues/52753#issuecomment-3094732633. The test case that failed when numpy `1.26.4` is installed now pass because `numpy.bool` is the NumPy scalar in `2.3.1`. ``` Installed 2 packages in 116ms - numpy==1.26.4 + numpy==2.3.1 - pandas==2.1.4 + pandas==2.3.1 ``` <img width="1255" height="221" alt="Screenshot from 2025-07-23 22-03-51" src="https://github.com/user-attachments/assets/24650064-8595-4cce-8b35-689c8f05dcd0" /> If we only upgrade numpy to 2.x and didn't update pandas, the following error is raised. (`uv pip install --upgrade numpy`) ``` Installed 1 package in 188ms - numpy==1.26.4 + numpy==2.3.1 ``` <img width="1255" height="331" alt="Screenshot from 2025-07-23 22-06-31" src="https://github.com/user-attachments/assets/d54fb4cb-8ec3-4d5b-a05f-55f9f490919d" /> ### DAG Test (Run-time Behavior) **Numpy version 1.26.4** <img width="1285" height="801" alt="Screenshot from 2025-07-23 21-25-14" src="https://github.com/user-attachments/assets/ead88de2-4e01-4086-9c61-5d9e161b93e9" /> **Numpy version 2.3.1** <img width="1285" height="801" alt="Screenshot from 2025-07-23 21-25-25" src="https://github.com/user-attachments/assets/6559eb17-d915-4d31-ab98-bf7c2e69e4d2" /> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <!-- Thank you for contributing! Please make sure that your code changes are covered with tests. And in case of new features or big changes remember to adjust the documentation. Feel free to ping committers for the review! In case of an existing issue, reference it using one of the following: closes: #ISSUE related: #ISSUE How to write a good git commit message: http://chris.beams.io/posts/git-commit/ --> <!-- Please keep an empty line above the dashes. --> --- **^ Add meaningful description above** Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)** for more information. In case of fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed. In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x). In case of backwards incompatible changes please leave a note in a newsfragment file, named `{pr_number}.significant.rst` or `{issue_number}.significant.rst`, in [airflow-core/newsfragments](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments). -- 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]
