Commit bb168693 authored by Nsukami Patrick's avatar Nsukami Patrick
Browse files

[mypy] Fix various errors related to subject & object attributes

Updates:
--------
- Annotate subject attribute as a Union of nullobject, str, None
- Annotate object attribute as a Union of nullobject, str, None


And fix the following errors:
-----------------------------
yams/buildobjs.py:966: error: Incompatible types in assignment (expression has type "str", variable has type "nullobject")  [assignment]
		self.subject = subject
			       ^
yams/buildobjs.py:971: error: Incompatible types in assignment (expression has type "str", variable has type "nullobject")  [assignment]
		self.object = object

yams/buildobjs.py:603: error: Incompatible types in assignment (expression has type "str", variable has type "nullobject")  [assignment]
				relation_definition.subject = name
							      ^
yams/buildobjs.py:606: error: Incompatible types in assignment (expression has type "str", variable has type "nullobject")  [assignment]
				relation_definition.object = name
parent c312ff9d2c1b
Pipeline #100256 passed with stages
in 1 minute and 9 seconds
......@@ -945,8 +945,8 @@ class RelationDefinition(Definition):
# and the symmetric property.
# """
subject = MARKER
object = MARKER
subject: Union[nullobject, str, None] = MARKER
object: Union[nullobject, str, None] = MARKER
cardinality: Union[nullobject, str, None] = MARKER
constraints = MARKER
symmetric = MARKER
......
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