Skip to content

Commit f9c7862

Browse files
Wrong typing for AsyncRelationshipDefinition __init__ param #854
1 parent b90b48b commit f9c7862

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

.sonarcloud.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
sonar.sources = neomodel/
22
sonar.tests = test/
3-
sonar.python.version = 3.7, 3.8, 3.9, 3.10, 3.11
3+
sonar.python.version = 3.9, 3.10, 3.11, 3.12, 3.13

neomodel/async_/relationship_manager.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ def __init__(
433433
cls_name: str,
434434
direction: int,
435435
manager: type[AsyncRelationshipManager] = AsyncRelationshipManager,
436-
model: Optional[AsyncStructuredRel] = None,
436+
model: Optional[type[AsyncStructuredRel]] = None,
437437
) -> None:
438438
self._validate_class(cls_name, model)
439439

@@ -486,7 +486,7 @@ def __init__(
486486
adb._NODE_CLASS_REGISTRY[label_set] = model
487487

488488
def _validate_class(
489-
self, cls_name: str, model: Optional[AsyncStructuredRel] = None
489+
self, cls_name: str, model: Optional[type[AsyncStructuredRel]] = None
490490
) -> None:
491491
if not isinstance(cls_name, (str, object)):
492492
raise ValueError("Expected class name or class got " + repr(cls_name))
@@ -552,7 +552,7 @@ def __init__(
552552
cls_name: str,
553553
relation_type: str,
554554
cardinality: type[AsyncRelationshipManager] = AsyncZeroOrMore,
555-
model: Optional[AsyncStructuredRel] = None,
555+
model: Optional[type[AsyncStructuredRel]] = None,
556556
) -> None:
557557
super().__init__(
558558
relation_type, cls_name, OUTGOING, manager=cardinality, model=model
@@ -565,7 +565,7 @@ def __init__(
565565
cls_name: str,
566566
relation_type: str,
567567
cardinality: type[AsyncRelationshipManager] = AsyncZeroOrMore,
568-
model: Optional[AsyncStructuredRel] = None,
568+
model: Optional[type[AsyncStructuredRel]] = None,
569569
) -> None:
570570
super().__init__(
571571
relation_type, cls_name, INCOMING, manager=cardinality, model=model
@@ -578,7 +578,7 @@ def __init__(
578578
cls_name: str,
579579
relation_type: str,
580580
cardinality: type[AsyncRelationshipManager] = AsyncZeroOrMore,
581-
model: Optional[AsyncStructuredRel] = None,
581+
model: Optional[type[AsyncStructuredRel]] = None,
582582
) -> None:
583583
super().__init__(
584584
relation_type, cls_name, EITHER, manager=cardinality, model=model

neomodel/sync_/relationship_manager.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ def __init__(
410410
cls_name: str,
411411
direction: int,
412412
manager: type[RelationshipManager] = RelationshipManager,
413-
model: Optional[StructuredRel] = None,
413+
model: Optional[type[StructuredRel]] = None,
414414
) -> None:
415415
self._validate_class(cls_name, model)
416416

@@ -463,7 +463,7 @@ def __init__(
463463
db._NODE_CLASS_REGISTRY[label_set] = model
464464

465465
def _validate_class(
466-
self, cls_name: str, model: Optional[StructuredRel] = None
466+
self, cls_name: str, model: Optional[type[StructuredRel]] = None
467467
) -> None:
468468
if not isinstance(cls_name, (str, object)):
469469
raise ValueError("Expected class name or class got " + repr(cls_name))
@@ -527,7 +527,7 @@ def __init__(
527527
cls_name: str,
528528
relation_type: str,
529529
cardinality: type[RelationshipManager] = ZeroOrMore,
530-
model: Optional[StructuredRel] = None,
530+
model: Optional[type[StructuredRel]] = None,
531531
) -> None:
532532
super().__init__(
533533
relation_type, cls_name, OUTGOING, manager=cardinality, model=model
@@ -540,7 +540,7 @@ def __init__(
540540
cls_name: str,
541541
relation_type: str,
542542
cardinality: type[RelationshipManager] = ZeroOrMore,
543-
model: Optional[StructuredRel] = None,
543+
model: Optional[type[StructuredRel]] = None,
544544
) -> None:
545545
super().__init__(
546546
relation_type, cls_name, INCOMING, manager=cardinality, model=model
@@ -553,7 +553,7 @@ def __init__(
553553
cls_name: str,
554554
relation_type: str,
555555
cardinality: type[RelationshipManager] = ZeroOrMore,
556-
model: Optional[StructuredRel] = None,
556+
model: Optional[type[StructuredRel]] = None,
557557
) -> None:
558558
super().__init__(
559559
relation_type, cls_name, EITHER, manager=cardinality, model=model

0 commit comments

Comments
 (0)