Skip to content

Commit

Permalink
Activate RUF006 rule to detect dangling asyncio tasks (#38947)
Browse files Browse the repository at this point in the history
  • Loading branch information
hussein-awala authored Apr 12, 2024
1 parent 41869d3 commit b3b9079
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion tests/providers/google/cloud/triggers/test_bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ async def test_value_check_op_trigger_success(
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()
Expand Down

0 comments on commit b3b9079

Please sign in to comment.