Skip to content

Commit

Permalink
fixes #911
Browse files Browse the repository at this point in the history
  • Loading branch information
07pepa committed Sep 14, 2024
1 parent ca585b1 commit 57e6bba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
11 changes: 4 additions & 7 deletions beanie/odm/utils/init.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import asyncio
import sys

from typing_extensions import Sequence, get_args, get_origin

from beanie.odm.utils.pydantic import (
IS_PYDANTIC_V2,
get_extra_field_info,
Expand All @@ -9,11 +11,6 @@
)
from beanie.odm.utils.typing import get_index_attributes

if sys.version_info >= (3, 8):
from typing import get_args, get_origin
else:
from typing_extensions import get_args, get_origin

if sys.version_info >= (3, 10):
from types import UnionType as TypesUnionType
else:
Expand Down Expand Up @@ -65,7 +62,7 @@ def __init__(
database: AsyncIOMotorDatabase = None,
connection_string: Optional[str] = None,
document_models: Optional[
List[Union[Type["DocType"], Type["View"], str]]
Sequence[Union[Type["DocType"], Type["View"], str]]
] = None,
allow_index_dropping: bool = False,
recreate_views: bool = False,
Expand Down Expand Up @@ -757,7 +754,7 @@ async def init_beanie(
database: AsyncIOMotorDatabase = None,
connection_string: Optional[str] = None,
document_models: Optional[
List[Union[Type[Document], Type["View"], str]]
Sequence[Union[Type[Document], Type["View"], str]]
] = None,
allow_index_dropping: bool = False,
recreate_views: bool = False,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ dependencies = [
"click>=7",
"toml",
"lazy-model==0.2.0",
"typing-extensions>=4.7; python_version < '3.11'",
"typing-extensions>=4.7",
]

[project.optional-dependencies]
Expand Down

0 comments on commit 57e6bba

Please sign in to comment.