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

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

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 16 (11 by maintainers)

Commits related to this issue

Most upvoted comments

Cool. Thanks For helping to verify it 👍

Thanks for taking care of the issue, I can confirm it works now:

[2023-01-09, 10:54:48 CET] {exasol.py:203} INFO - Running statement: EXECUTE SCRIPT mohn_fw.update_select_to_date_for_area('CORE'), parameters: None
[2023-01-09, 10:54:48 CET] {exasol.py:212} INFO - Rows affected: <bound method ExaStatement.rowcount of <ExaStatement session_id=1754538679605737261 stmt_idx=1>>
[2023-01-09, 10:54:48 CET] {taskinstance.py:1322} INFO - Marking task as SUCCESS. dag_id=MOH_DWH_DAILY_CORE, task_id=update_select_to_date_for_area, execution_date=20230101T210000, start_date=20230109T095447, end_date=20230109T095448

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.