Skip to content

Commit 6786850

Browse files
Remove left-over Optional() class
1 parent 16ffa19 commit 6786850

File tree

2 files changed

+4
-22
lines changed

2 files changed

+4
-22
lines changed

neomodel/async_/match.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
import re
33
import string
44
from dataclasses import dataclass
5-
from typing import Any, AsyncIterator
6-
from typing import Optional as TOptional
7-
from typing import Union
5+
from typing import Any, AsyncIterator, Optional, Union
86

97
from neomodel.async_ import relationship_manager
108
from neomodel.async_.database import adb
@@ -1281,7 +1279,7 @@ async def check_contains(self, obj: AsyncStructuredNode | Any) -> bool:
12811279

12821280
raise ValueError("Expecting StructuredNode instance")
12831281

1284-
async def get_item(self, key: int | slice) -> TOptional["AsyncBaseSet"]:
1282+
async def get_item(self, key: int | slice) -> Optional["AsyncBaseSet"]:
12851283
if isinstance(key, slice):
12861284
if key.stop and key.start:
12871285
self.limit = key.stop - key.start
@@ -1302,13 +1300,6 @@ async def get_item(self, key: int | slice) -> TOptional["AsyncBaseSet"]:
13021300
return _first_item
13031301

13041302

1305-
@dataclass
1306-
class Optional: # type: ignore[no-redef]
1307-
"""Simple relation qualifier."""
1308-
1309-
relation: str
1310-
1311-
13121303
@dataclass
13131304
class Path:
13141305
"""Path traversal definition."""

neomodel/sync_/match.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
import re
33
import string
44
from dataclasses import dataclass
5-
from typing import Any, Iterator
6-
from typing import Optional as TOptional
7-
from typing import Union
5+
from typing import Any, Iterator, Optional, Union
86

97
from neomodel.exceptions import MultipleNodesReturned
108
from neomodel.match_q import Q, QBase
@@ -1277,7 +1275,7 @@ def __contains__(self, obj: StructuredNode | Any) -> bool:
12771275

12781276
raise ValueError("Expecting StructuredNode instance")
12791277

1280-
def __getitem__(self, key: int | slice) -> TOptional["BaseSet"]:
1278+
def __getitem__(self, key: int | slice) -> Optional["BaseSet"]:
12811279
if isinstance(key, slice):
12821280
if key.stop and key.start:
12831281
self.limit = key.stop - key.start
@@ -1298,13 +1296,6 @@ def __getitem__(self, key: int | slice) -> TOptional["BaseSet"]:
12981296
return _first_item
12991297

13001298

1301-
@dataclass
1302-
class Optional: # type: ignore[no-redef]
1303-
"""Simple relation qualifier."""
1304-
1305-
relation: str
1306-
1307-
13081299
@dataclass
13091300
class Path:
13101301
"""Path traversal definition."""

0 commit comments

Comments
 (0)