airflow: AttributeError: 'ExaStatement' object has no attribute 'description'
Apache Airflow Provider(s)
exasol
Versions of Apache Airflow Providers
apache-airflow-providers-common-sql==1.3.1 apache-airflow-providers-exasol==4.1.1
Apache Airflow version
2.5.0
Operating System
Rocky Linux 8.7 (like RHEL 8.7)
Deployment
Other Docker-based deployment
Deployment details
- Docker Images built using Python 3.9 and recommended constraints https://raw.githubusercontent.com/apache/airflow/constraints-2.5.0/constraints-3.9.txt
- Deployment to AWS ECS
What happened
After upgrading from Airflow 2.4.3 to 2.5.0, the ExasolOperator stopped working even when executing simple SQL Statements. See log snippet below for details.
It looks like the Exasol Hook fails due to a missing attribute. It seems likely the issue was introduced in a refactoring of the Exasol Hook to use common DBApiHook https://github.com/apache/airflow/pull/28009/commits
What you think should happen instead
No response
How to reproduce
Any execution of ExasolOperator in Airflow built with the mentioned constraints should show the issue.
Anything else
[2023-01-04, 15:31:33 CET] {exasol.py:176} INFO - Running statement: EXECUTE SCRIPT mohn_fw.update_select_to_date_for_area('CORE'), parameters: None
[2023-01-04, 15:31:33 CET] {taskinstance.py:1772} ERROR - Task failed with exception
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/airflow/providers/common/sql/operators/sql.py", line 255, in execute
output = hook.run(
File "/usr/local/lib/python3.9/site-packages/airflow/providers/exasol/hooks/exasol.py", line 178, in run
result = handler(cur)
File "/usr/local/lib/python3.9/site-packages/airflow/providers/common/sql/hooks/sql.py", line 62, in fetch_all_handler
if cursor.description is not None:
AttributeError: 'ExaStatement' object has no attribute 'description'
[2023-01-04, 15:31:33 CET] {taskinstance.py:1322} INFO - Marking task as UP_FOR_RETRY. dag_id=MOH_DWH_DAILY_CORE, task_id=update_select_to_date_for_area, execution_date=20221225T210000, start_date=20230104T143132, end_date=20230104T143133
[2023-01-04, 15:31:33 CET] {standard_task_runner.py:100} ERROR - Failed to execute job 46137 for task update_select_to_date_for_area ('ExaStatement' object has no attribute 'description'; 7245)
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project’s Code of Conduct
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 16 (11 by maintainers)
Commits related to this issue
- Handle non-compliant behaviour of Exasol cursor Exasol is not DBAPI-2 compliant, as described in: https://github.com/exasol/pyexasol/blob/master/docs/DBAPI_COMPAT.md This means that SQLOperator cann... — committed to potiuk/airflow by potiuk a year ago
- Handle non-compliant behaviour of Exasol cursor (#28744) Exasol is not DBAPI-2 compliant, as described in: https://github.com/exasol/pyexasol/blob/master/docs/DBAPI_COMPAT.md This means that SQLO... — committed to apache/airflow by potiuk a year ago
Cool. Thanks For helping to verify it 👍
Thanks for taking care of the issue, I can confirm it works now:
Thanks for jumping at this topic so quickly! It turned out the issue was introduced in apache-airflow-providers-exasol==4.1.0 already, but going back to 4.0.1 works for now.