Skip to content

Commit 93a6dbf

Browse files
authored
Add Pre-Commit Hook To Prevent Usage of session.query (#52083)
* add pre-commit hook to prevent usage of session.query * Add proper name in pre-commit hook id and name * rename pre-commit-python file * chnage file name from pre-commit hook
1 parent 4877df7 commit 93a6dbf

File tree

6 files changed

+118
-45
lines changed

6 files changed

+118
-45
lines changed

.pre-commit-config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,16 @@ repos:
537537
pass_filenames: false
538538
require_serial: true
539539
additional_dependencies: ['rich>=12.4.4']
540+
- id: prevent-deprecated-sqlalchemy-usage
541+
name: Prevent deprecated sqlalchemy usage
542+
entry: ./scripts/ci/pre_commit/prevent_deprecated_sqlalchemy_usage.py
543+
language: python
544+
additional_dependencies: ['rich>=12.4.4']
545+
files: >
546+
(?x)
547+
^airflow-ctl.*\.py$|
548+
^task_sdk.*\.py$
549+
pass_filenames: true
540550
- id: update-supported-versions
541551
name: Updates supported versions in documentation
542552
entry: ./scripts/ci/pre_commit/supported_versions.py

contributing-docs/08_static_code_checks.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,8 @@ require Breeze Docker image to be built locally.
354354
+-----------------------------------------------------------+--------------------------------------------------------+---------+
355355
| pretty-format-json | Format JSON files | |
356356
+-----------------------------------------------------------+--------------------------------------------------------+---------+
357+
| prevent-deprecated-sqlalchemy-usage | Prevent deprecated sqlalchemy usage | |
358+
+-----------------------------------------------------------+--------------------------------------------------------+---------+
357359
| pylint | pylint | |
358360
+-----------------------------------------------------------+--------------------------------------------------------+---------+
359361
| python-no-log-warn | Check if there are no deprecate log warn | |

0 commit comments

Comments
 (0)