This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new b3b90794cb Activate RUF006 rule to detect dangling asyncio tasks
(#38947)
b3b90794cb is described below
commit b3b90794cb01df968fcb89032b8f95577a7592aa
Author: Hussein Awala <[email protected]>
AuthorDate: Fri Apr 12 11:47:42 2024 +0200
Activate RUF006 rule to detect dangling asyncio tasks (#38947)
---
.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 85c35c95e3..4fb1555f5f 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 ee55d35bc3..0e5dcef675 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -290,6 +290,7 @@ extend-select = [
"B017", # Checks for pytest.raises context managers that catch Exception
or BaseException.
"B019", # Use of functools.lru_cache or functools.cache on methods can
lead to memory leaks
"TRY002", # Prohibit use of `raise Exception`, use specific exceptions
instead.
+ "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()