Skip to content

[Bug]: DeprecationWarning: asyncio.iscoroutinefunction on Python 3.14 #3293

Description

@LovelyQuantum

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

pymilvus 2.6.9 emits hundreds of DeprecationWarning on Python 3.14 due to usage of asyncio.iscoroutinefunction() in decorators.py (lines 88, 175, 333, 430). This function was deprecated in Python 3.14 and is scheduled for removal in Python 3.16.

Warning output:

pymilvus/decorators.py:88: DeprecationWarning: 'asyncio.iscoroutinefunction' is deprecated and slated for removal in Python 3.16; use inspect.iscoroutinefunction() instead
    if asyncio.iscoroutinefunction(func):

Expected Behavior

No deprecation warnings. asyncio.iscoroutinefunction should be replaced with inspect.iscoroutinefunction.
inspect.iscoroutinefunction is available since Python 3.5, so this is fully backward-compatible.

Steps/Code To Reproduce behavior

import warnings
warnings.simplefilter("always", DeprecationWarning)
from pymilvus import MilvusClient

Environment details

- Hardware/Software conditions: macOS (Apple Silicon)
- Method of installation: pip / uv
- pymilvus version: 2.6.9
- Python version: 3.14.3

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions