@@ -94,6 +94,8 @@ class RelationshipInterpretation(Interpretation, alias="relationship"):
94
94
"properties_normalization" ,
95
95
"key_search_algorithm" ,
96
96
"node_additional_types" ,
97
+ "node_update_last_ingested" ,
98
+ "relationship_update_last_ingested" ,
97
99
)
98
100
99
101
@deprecated_arugment ("match_strategy" , "node_creation_rule" )
@@ -113,6 +115,8 @@ def __init__(
113
115
key_normalization : Optional [Dict [str , Any ]] = None ,
114
116
properties_normalization : Optional [Dict [str , Any ]] = None ,
115
117
node_additional_types : Optional [Iterable [str ]] = None ,
118
+ node_update_last_ingested : bool = True ,
119
+ relationship_update_last_ingested : bool = True ,
116
120
):
117
121
self .can_find_many = find_many or iterate_on is not None
118
122
self .cardinality = Cardinality (cardinality )
@@ -146,6 +150,8 @@ def __init__(
146
150
self .node_key , self .key_normalization
147
151
)
148
152
self .node_additional_types = tuple (node_additional_types or tuple ())
153
+ self .node_update_last_ingested = node_update_last_ingested
154
+ self .relationship_update_last_ingested = relationship_update_last_ingested
149
155
150
156
def interpret (self , context : ProviderContext ):
151
157
for sub_context in self .decomposer .decompose_record (context ):
@@ -156,6 +162,10 @@ def interpret(self, context: ProviderContext):
156
162
157
163
def find_relationship (self , context : ProviderContext ) -> Relationship :
158
164
rel = Relationship (type = self .relationship_type .single_value (context ))
165
+
166
+ if not self .relationship_update_last_ingested :
167
+ rel .properties .remove_last_ingested ()
168
+
159
169
relationship_key_property_mapping = PropertyMappingFromDict (
160
170
self .relationship_key
161
171
)
@@ -174,6 +184,10 @@ def find_related_nodes(self, context: ProviderContext) -> Iterable[Node]:
174
184
key_values = PropertySet (key_set ),
175
185
additional_types = self .node_additional_types ,
176
186
)
187
+
188
+ if not self .node_update_last_ingested :
189
+ node .properties .remove_last_ingested ()
190
+
177
191
if node .has_valid_id :
178
192
self .node_properties .apply_to (
179
193
context , node .properties , self .properties_normalization
0 commit comments