If you’ve upgraded from Airflow 2.4.3 to Airflow 2.5.1 (especially in MWAA) and suddenly find that the pandas module is missing from Python, why is this happening?
It’s because you don’t have pandas in your requirements.txt. Although pandas seems to be an integral part of Airflow, it is not. It is installed by default in Airflow 2.4.3 because it is a requirement of apache-airflow-providers-postgres v5.2.2.
However, Airflow 2.5.1 uses apache-airflow-providers-postgres v5.4.0 which doesn’t have that same requirement. So you previously relied on a happy coincidence to have pandas installed by default. Now you’ll need to have it installed by adding it to your requirements.txt file.
Good luck!