Skip to content

Commit

Permalink
Use Any instead of TypeVar
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego committed Jan 19, 2025
1 parent 92a3ee9 commit 80805f5
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions py-polars/polars/io/database/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import re
import threading
from concurrent.futures import ThreadPoolExecutor
from typing import TYPE_CHECKING, Any, TypeVar
from typing import TYPE_CHECKING, Any

from polars.convert import from_arrow
from polars.dependencies import import_optional
Expand All @@ -16,10 +16,9 @@
from polars._typing import SchemaDict


T = TypeVar("T")


def _run_async(coroutine: Coroutine[Any, Any, T], *, timeout: float | None = None) -> T:
def _run_async(
coroutine: Coroutine[Any, Any, Any], *, timeout: float | None = None
) -> Any:
"""Run asynchronous code as if it were synchronous.
This is required for execution in Jupyter notebook environments.
Expand All @@ -33,7 +32,7 @@ def _run_async(coroutine: Coroutine[Any, Any, T], *, timeout: float | None = Non
# If there is no running loop, use `asyncio.run` normally
return asyncio.run(coroutine)

def run_in_new_loop() -> T:
def run_in_new_loop() -> Any:
new_loop = asyncio.new_event_loop()
asyncio.set_event_loop(new_loop)
try:
Expand Down

0 comments on commit 80805f5

Please sign in to comment.