-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
Hi
there seems be an issue with generating schema (CollectionBase.schema) for Edges/Relations with custom attributes (like SpecializesIn ) in specific case.
Here are few examples:
- when
schemamethod is run forSpecializesInfirst (before any other relations) everything is fine
(Pdb) self._graph.edges['specializes_in'].schema().fields.keys()
<class 'tests.data.SpecializesIn'>
dict_keys(['expertise_level', '_key']) # 'expertise_level' is present
(Pdb) self._graph.edges['studies'].schema().fields.keys()
<class 'arango_orm.collections.Relation'>
dict_keys([])
- if
schemamethod is run for Relation first it does not generate correct schema
(Pdb) self._graph.edges['studies'].schema().fields.keys()
<class 'arango_orm.collections.Relation'>
dict_keys([])
(Pdb) self._graph.edges['specializes_in'].schema().fields.keys()
<class 'tests.data.SpecializesIn'>
dict_keys([]) # IS EMPTY
is happens because Relation._cls_schema is already generated/cached at the first step (self._graph.edges['studies'].schema()) and it is used when self._graph.edges['specializes_in'].schema() is run. SpecializesIn is inherited from Relation so it uses Relation._cls_schema data
Metadata
Metadata
Assignees
Labels
No labels