Commit 5f3b7465 authored by Laurent Peuch's avatar Laurent Peuch
Browse files

[types] Defintion.name is of type DefinitionName

parent 3ca6cf2849b1
......@@ -129,7 +129,7 @@ def _add_constraint(kwargs: Dict[str, Any], constraint: BaseConstraint) -> None:
def _add_relation(
relations: List["RelationDefinition"],
relation_definition: "RelationDefinition",
name: Optional[str] = None,
name: Optional[yams_types.DefinitionName] = None,
insert_index: Optional[int] = None,
) -> None:
"""Add relation (param relation_definition) to list of relations (param relations)."""
......@@ -216,7 +216,9 @@ class Definition(object, metaclass=autopackage):
__permissions__ = MARKER
def __init__(self, name=None) -> None:
self.name: str = (name or getattr(self, "name", None) or self.__class__.__name__)
self.name: yams_types.DefinitionName = yams_types.DefinitionName(
name or getattr(self, "name", None) or self.__class__.__name__
)
if self.__doc__:
self.description = " ".join(self.__doc__.split())
......
......@@ -114,7 +114,9 @@ class ERSchema:
"""Base class shared by entity and relation schema."""
@deprecation.argument_renamed(old_name="erdef", new_name="entity_relation_definition")
def __init__(self, schema: "Schema", entity_relation_definition=None) -> None:
def __init__(
self, schema: "Schema", entity_relation_definition: yams_types.RelationDefinition = None
) -> None:
"""
Construct an ERSchema instance.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment