-
Notifications
You must be signed in to change notification settings - Fork 14.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AttributeError: 'PostgresHook' object has no attribute 'schema' #17422
Comments
Thanks for opening your first issue here! Be sure to follow the issue template! |
Can you provide output of airflow providers list command? I have the impression that the latest package requires Airflow 2.2. |
Yeah. I swa some other errors related to that and just yanked the new 2.1.0 Postgres release (we should be able to fix it easily) |
For now downgrading Postgres operator to 2.0.0 should fix the problem. |
Yep. Confirmed. We have unintended backwards incompatibility with Postgres Hook |
There was a change in apache#16521 that introduced schema field in DBApiHook, but unfortunately using it in provider Hooks deriving from DBApiHook is backwards incompatible for Airflow 2.1 and below. This caused Postgres 2.1.0 release backwards incompatibility and failures for Airflow 2.1.0. Since the change is small and most of DBApi-derived hooks already set the schema field on their own, the best approach is to make the schema field private for the DBApiHook and make a change in Postgres Hook to store the schema in the same way as all other operators. Fixes: apache#17422
There was a change in apache#16521 that introduced schema field in DBApiHook, but unfortunately using it in provider Hooks deriving from DBApiHook is backwards incompatible for Airflow 2.1 and below. This caused Postgres 2.1.0 release backwards incompatibility and failures for Airflow 2.1.0. Since the change is small and most of DBApi-derived hooks already set the schema field on their own, the best approach is to make the schema field private for the DBApiHook and make a change in Postgres Hook to store the schema in the same way as all other operators. Fixes: apache#17422
There was a change in #16521 that introduced schema field in DBApiHook, but unfortunately using it in provider Hooks deriving from DBApiHook is backwards incompatible for Airflow 2.1 and below. This caused Postgres 2.1.0 release backwards incompatibility and failures for Airflow 2.1.0. Since the change is small and most of DBApi-derived hooks already set the schema field on their own, the best approach is to make the schema field private for the DBApiHook and make a change in Postgres Hook to store the schema in the same way as all other operators. Fixes: #17422
Apache Airflow version: 2.1.0
Kubernetes version (if you are using kubernetes) (use
kubectl version
):1.21Environment:
uname -a
):Linux workspaceWhat happened:
Running PostgresOperator errors out with 'PostgresHook' object has no attribute 'schema'.
I tested it as well with the code from PostgresOperator tutorial in https://airflow.apache.org/docs/apache-airflow-providers-postgres/stable/operators/postgres_operator_howto_guide.html
This is happening since upgrade of apache-airflow-providers-postgres to version 2.1.0
What you expected to happen:
How to reproduce it:
Anything else we need to know:
The text was updated successfully, but these errors were encountered: