Skip to content
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

Module airflow.hooks.dbapi removed #41748

Merged
merged 2 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions airflow/hooks/dbapi.py

This file was deleted.

1 change: 1 addition & 0 deletions newsfragments/41748.significant.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Deprecated module ``airflow.hooks.dbapi`` removed. Please use ``airflow.providers.common.sql.hooks.sql`` instead.
10 changes: 0 additions & 10 deletions tests/providers/common/sql/hooks/test_dbapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import pytest
from pyodbc import Cursor

from airflow.exceptions import RemovedInAirflow3Warning
from airflow.hooks.base import BaseHook
from airflow.models import Connection
from airflow.providers.common.sql.hooks.sql import DbApiHook, fetch_all_handler, fetch_one_handler
Expand Down Expand Up @@ -537,15 +536,6 @@ def test_instance_check_works_for_provider_derived_hook(self):
def test_instance_check_works_for_non_db_api_hook(self):
assert not isinstance(NonDbApiHook(), DbApiHook)

def test_instance_check_works_for_legacy_db_api_hook(self):
with pytest.warns(
RemovedInAirflow3Warning,
match="This module is deprecated. Please use `airflow.providers.common.sql.hooks.sql`.",
):
from airflow.hooks.dbapi import DbApiHook as LegacyDbApiHook

assert isinstance(DbApiHookInProvider(), LegacyDbApiHook)

def test_run_fetch_all_handler_select_1(self):
self.cur.rowcount = -1 # can be -1 according to pep249
self.cur.description = (tuple([None] * 7),)
Expand Down