This is an automated email from the ASF dual-hosted git repository.

utkarsharma pushed a commit to branch v2-9-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 03bbb042ba6f727861e3a5d3808d085301c3ce82
Author: Hussein Awala <[email protected]>
AuthorDate: Fri Apr 12 11:47:42 2024 +0200

    Activate RUF006 rule to detect dangling asyncio tasks (#38947)
    
    (cherry picked from commit b3b90794cb01df968fcb89032b8f95577a7592aa)
---
 .pre-commit-config.yaml                                | 4 ++--
 pyproject.toml                                         | 1 +
 tests/providers/google/cloud/triggers/test_bigquery.py | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 2a859427cf..8a8a39ff40 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -335,7 +335,7 @@ repos:
         types_or: [python, pyi]
         args: [--fix]
         require_serial: true
-        additional_dependencies: ["ruff==0.3.5"]
+        additional_dependencies: ["ruff==0.3.6"]
         exclude: ^.*/.*_vendor/|^tests/dags/test_imports.py
       - id: ruff-format
         name: Run 'ruff format' for extremely fast Python formatting
@@ -345,7 +345,7 @@ repos:
         types_or: [python, pyi]
         args: []
         require_serial: true
-        additional_dependencies: ["ruff==0.3.5"]
+        additional_dependencies: ["ruff==0.3.6"]
         exclude: ^.*/.*_vendor/|^tests/dags/test_imports.py|^airflow/contrib/
       - id: replace-bad-characters
         name: Replace bad characters
diff --git a/pyproject.toml b/pyproject.toml
index 853fa2eaaf..22d4096295 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -289,6 +289,7 @@ extend-select = [
     "B004", # Checks for use of hasattr(x, "__call__") and replaces it with 
callable(x)
     "B006", # Checks for uses of mutable objects as function argument defaults.
     "B019", # Use of functools.lru_cache or functools.cache on methods can 
lead to memory leaks
+    "RUF006", # Checks for asyncio dangling task
 ]
 ignore = [
     "D203",
diff --git a/tests/providers/google/cloud/triggers/test_bigquery.py 
b/tests/providers/google/cloud/triggers/test_bigquery.py
index ed4861ca76..8c4318fde4 100644
--- a/tests/providers/google/cloud/triggers/test_bigquery.py
+++ b/tests/providers/google/cloud/triggers/test_bigquery.py
@@ -601,7 +601,7 @@ class TestBigQueryValueCheckTrigger:
         get_job_output.return_value = {}
         get_records.return_value = [[2], [4]]
 
-        asyncio.create_task(value_check_trigger.run().__anext__())
+        await value_check_trigger.run().__anext__()
         await asyncio.sleep(0.5)
 
         generator = value_check_trigger.run()

Reply via email to