Skip to content

SQLExecuteQueryOperator Failing as get_hook is not implemented in Task-SDK. #47353

Description

@vatsrahul1001

Body

In #47048 we migrated getting connections from BaseHook using task SDK. After this SQLExecuteQueryOperator is failing as get_hook is not implemented in Task-SDK.

LOGS

[2025-03-04T17:55:23.565974Z] ERROR - Task failed with exception logger="task" error_detail=[{"exc_type":"NameError","exc_value":"name 'import_string' is not defined","syntax_error":null,"is_cause":false,"frames":[{"filename":"/opt/airflow/task_sdk/src/airflow/sdk/execution_time/task_runner.py","lineno":605,"name":"run"},{"filename":"/opt/airflow/task_sdk/src/airflow/sdk/execution_time/task_runner.py","lineno":726,"name":"_execute_task"},{"filename":"/opt/airflow/airflow/models/baseoperator.py","lineno":168,"name":"wrapper"},{"filename":"/opt/airflow/providers/common/sql/src/airflow/providers/common/sql/operators/sql.py","lineno":296,"name":"execute"},{"filename":"/opt/airflow/providers/common/sql/src/airflow/providers/common/sql/operators/sql.py","lineno":195,"name":"get_db_hook"},{"filename":"/usr/local/lib/python3.9/functools.py","lineno":993,"name":"get"},{"filename":"/opt/airflow/providers/common/sql/src/airflow/providers/common/sql/operators/sql.py","lineno":171,"name":"_hook"},{"filename":"/opt/airflow/providers/common/sql/src/airflow/providers/common/sql/operators/sql.py","lineno":164,"name":"get_hook"},{"filename":"/opt/airflow/task_sdk/src/airflow/sdk/definitions/connection.py","lineno":71,"name":"get_hook"}]}]

[2025-03-04T17:55:23.566349Z] DEBUG - Sending request json="{"state":"failed","end_date":"2025-03-04T17:55:23.566304Z","type":"TaskState"}\n" logger="task"

Committer

  • I acknowledge that I am a maintainer/committer of the Apache Airflow project.

Metadata

Metadata

Assignees

Labels

area:providerskind:bugThis is a clearly a bugkind:metaHigh-level information important to the communitypriority:highHigh priority bug that should be patched quickly but does not require immediate new releaseprovider:common-sql

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions