Skip to content

Commit c339157

Browse files
authored
Remove deprecated Query usage and update to SQLAlchemy2.0 style for test_not_previously_skipped_dep.py (#59865)
* Fix deprecated sqlalchemy usage for test_processor.py * Remove deprecate Query usage and upgrade to SQLAlchemy2.0 * Updating files for test_not_previously_skipped_dep.py * Reverting changes to pyproject.toml files for test_not_previously_skipped_dep.py * Reverting changes to pyproject.toml files for test_not_previously_skipped_dep.py * Reverting changes to pyproject.toml files for test_not_previously_skipped_dep.py * Making changes to test_not_previously_skipped_dep.py * Making changes to pre-committest_not_previously_skipped_dep.py * Making changes to pre-commit-config * Fix pre-commit hook issues hopefully
1 parent fc8a53a commit c339157

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@ repos:
463463
^airflow-core/tests/unit/utils/test_db_cleanup.py$|
464464
^airflow-core/tests/unit/utils/test_state.py$|
465465
^airflow-core/tests/unit/utils/test_log_handlers.py$|
466+
^airflow-core/tests/unit/ti_deps/deps/test_not_previously_skipped_dep.py$|
466467
^airflow-core/tests/unit/utils/test_types.py$|
467468
^airflow-core/tests/unit/dag_processing/test_manager.py$|
468469
^airflow-core/tests/unit/dag_processing/test_processor.py$|

airflow-core/tests/unit/ti_deps/deps/test_not_previously_skipped_dep.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import pendulum
2121
import pytest
22+
from sqlalchemy import delete
2223

2324
from airflow.models import DagRun, TaskInstance
2425
from airflow.providers.standard.operators.empty import EmptyOperator
@@ -36,8 +37,8 @@
3637
@pytest.fixture(autouse=True)
3738
def clean_db(session):
3839
yield
39-
session.query(DagRun).delete()
40-
session.query(TaskInstance).delete()
40+
session.execute(delete(DagRun))
41+
session.execute(delete(TaskInstance))
4142

4243

4344
def test_no_parent(session, dag_maker):

0 commit comments

Comments
 (0)