Skip to content

Apache Airflow SqlSensor DbApiHook Error #25274

Closed

Description

@vlcheong

Apache Airflow version

2.3.3 (latest released)

What happened

I trying to make SqlSensor to work with Oracle database, I've installed all the required provider and successfully tested the connection. When I run SqlSensor I got this error message
ERROR - Failed to execute job 32 for task check_exec_date (The connection type is not supported by SqlSensor. The associated hook should be a subclass of DbApiHook. Got OracleHook; 419)

What you think should happen instead

No response

How to reproduce

No response

Operating System

Ubuntu 20.04.4 LTS

Versions of Apache Airflow Providers

apache-airflow-providers-common-sql==1.0.0
apache-airflow-providers-ftp==3.0.0
apache-airflow-providers-http==3.0.0
apache-airflow-providers-imap==3.0.0
apache-airflow-providers-oracle==3.2.0
apache-airflow-providers-postgres==5.1.0
apache-airflow-providers-sqlite==3.0.0

Deployment

Other

Deployment details

Run on Windows Subsystem for Linux

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. boring-cyborg commented on Jul 25, 2022

    @boring-cyborg

    Thanks for opening your first issue here! Be sure to follow the issue template!

  2. modified the milestone: Airflow 2.3.4 on Jul 25, 2022
  3. potiuk commented on Jul 25, 2022

    @potiuk
    Member

    Please use the "Common-sql" sensor for that. Instead of from airflow.sensors import SqlSensor use from airflow.providers.common.sql.sensors import SqlSensors - that should fix the problem.

    This is one of the unforeseen effects of "common-sql" introduction.

    Unfortunately, other than documenting it, we cannot do much about it.

    Please let me know @vlcheong if it fixed your problem. if it does, I will make sure to add appropriate documentation about it.

  4. potiuk commented on Jul 25, 2022

    @potiuk
    Member

    Mybe I will find another solution for that in the future as well - I will think and dig a bit deeper.

  5. self-assigned this
    on Jul 25, 2022
  6. potiuk commented on Jul 25, 2022

    @potiuk
    Member

    Yeah. I found a solution that will make it works also if you use legacy SqlSensor (will be released in the next common.sql provider)

  7. potiuk commented on Jul 25, 2022

    @potiuk
    Member

    See #25293

  8. removed this from the Airflow 2.3.4 milestone on Jul 26, 2022
  9. added a commit that references this issue on Jul 27, 2022
    b0fd105
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions