MCPcopy
hub / github.com/apache/caldera / RelationshipSchema

Class RelationshipSchema

app/objects/secondclass/c_relationship.py:7–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5
6
7class RelationshipSchema(ma.Schema):
8
9 unique = ma.fields.String(dump_only=True)
10 source = ma.fields.Nested(FactSchema, required=True)
11 edge = ma.fields.String(allow_none=True)
12 target = ma.fields.Nested(FactSchema, allow_none=True)
13 score = ma.fields.Integer()
14 origin = ma.fields.String(allow_none=True)
15
16 @ma.pre_load
17 def remove_unique(self, data, **_):
18 data.pop('unique', None)
19 return data
20
21 @ma.post_load
22 def build_relationship(self, data, **kwargs):
23 return None if kwargs.get('partial') is True else Relationship(**data)
24
25
26class RelationshipUpdateSchema(ma.Schema):

Callers 4

LinkSchemaClass · 0.90
RelationshipClass · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected