@@ -150,14 +150,14 @@ def run(self, node_dfs: List[DataFrame], relationship_dfs: List[DataFrame]) -> N
150150
151151 is_cypher_projection_v2 = self ._server_version >= ServerVersion (2 , 4 , 0 )
152152
153- properties_key = (
153+ rel_properties_key = (
154154 CypherProjectionApi .REL_PROPERTIES_NEW
155155 if is_cypher_projection_v2
156156 else CypherProjectionApi .REL_PROPERTIES
157157 )
158158
159- aligned_node_dfs = self .adjust_node_dfs (node_dfs , graph_schema , properties_key )
160- aligned_rel_dfs = self .adjust_rel_dfs (relationship_dfs , graph_schema , properties_key )
159+ aligned_node_dfs = self .adjust_node_dfs (node_dfs , graph_schema , rel_properties_key )
160+ aligned_rel_dfs = self .adjust_rel_dfs (relationship_dfs , graph_schema , rel_properties_key )
161161
162162 # concat instead of join as we want to first have all nodes and then the rels
163163 # this way we don't duplicate the node property data and its cheaper
@@ -170,7 +170,7 @@ def run(self, node_dfs: List[DataFrame], relationship_dfs: List[DataFrame]) -> N
170170
171171 property_clauses : List [str ] = [
172172 self .check_value_clause (combined_cols , prop_col )
173- for prop_col in [CypherProjectionApi .SOURCE_NODE_PROPERTIES , properties_key ]
173+ for prop_col in [CypherProjectionApi .SOURCE_NODE_PROPERTIES , rel_properties_key ]
174174 ]
175175
176176 source_node_labels_clause = (
@@ -186,7 +186,7 @@ def run(self, node_dfs: List[DataFrame], relationship_dfs: List[DataFrame]) -> N
186186 target_id_clause = self .check_value_clause (combined_cols , "targetNodeId" )
187187
188188 nodes_config_part = self .nodes_config_part (graph_schema .nodes_per_df , is_cypher_projection_v2 )
189- rels_config_part = self .rels_config_part (graph_schema .rels_per_df , properties_key )
189+ rels_config_part = self .rels_config_part (graph_schema .rels_per_df , rel_properties_key )
190190
191191 if is_cypher_projection_v2 :
192192 data_config = f"{{{ ', ' .join (itertools .chain (nodes_config_part , rels_config_part ))} }}"
@@ -246,7 +246,7 @@ def schema(self, node_dfs: List[DataFrame], rel_dfs: List[DataFrame]) -> GraphCo
246246 return GraphColumnSchema (node_schema , rel_schema )
247247
248248 def adjust_node_dfs (
249- self , node_dfs : List [DataFrame ], schema : GraphColumnSchema , properties_key : str
249+ self , node_dfs : List [DataFrame ], schema : GraphColumnSchema , rel_properties_key : str
250250 ) -> List [DataFrame ]:
251251 adjusted_dfs = []
252252
@@ -274,15 +274,15 @@ def collect_to_dict(row: Dict[str, Any]) -> Dict[str, Any]:
274274 node_dict_df = DataFrame (node_dict )
275275 node_dict_df [CypherProjectionApi .SOURCE_NODE_PROPERTIES ] = df .apply (collect_to_dict , axis = 1 )
276276 node_dict_df [CypherProjectionApi .SOURCE_NODE_PROPERTIES + self ._BIT_COL_SUFFIX ] = True
277- node_dict_df [properties_key ] = None
278- node_dict_df [properties_key + self ._BIT_COL_SUFFIX ] = False
277+ node_dict_df [rel_properties_key ] = None
278+ node_dict_df [rel_properties_key + self ._BIT_COL_SUFFIX ] = False
279279
280280 adjusted_dfs .append (node_dict_df )
281281
282282 return adjusted_dfs
283283
284284 def adjust_rel_dfs (
285- self , rel_dfs : List [DataFrame ], schema : GraphColumnSchema , properties_key : str
285+ self , rel_dfs : List [DataFrame ], schema : GraphColumnSchema , rel_properties_key : str
286286 ) -> List [DataFrame ]:
287287 adjusted_dfs = []
288288
@@ -308,8 +308,8 @@ def collect_to_dict(row: Dict[str, Any]) -> Dict[str, Any]:
308308 return {column : row [column ] for column in schema .rels_per_df [i ].properties }
309309
310310 rel_dict_df = DataFrame (rel_dict )
311- rel_dict_df [properties_key ] = df .apply (collect_to_dict , axis = 1 )
312- rel_dict_df [properties_key + self ._BIT_COL_SUFFIX ] = True
311+ rel_dict_df [rel_properties_key ] = df .apply (collect_to_dict , axis = 1 )
312+ rel_dict_df [rel_properties_key + self ._BIT_COL_SUFFIX ] = True
313313 rel_dict_df [CypherProjectionApi .SOURCE_NODE_PROPERTIES ] = None
314314 rel_dict_df [CypherProjectionApi .SOURCE_NODE_PROPERTIES + self ._BIT_COL_SUFFIX ] = False
315315
@@ -342,7 +342,7 @@ def nodes_config_part(self, node_cols: List[EntityColumnSchema], is_cypher_proje
342342
343343 return nodes_config_fields
344344
345- def rels_config_part (self , rel_cols : List [EntityColumnSchema ], properties_key : str ) -> List [str ]:
345+ def rels_config_part (self , rel_cols : List [EntityColumnSchema ], rel_properties_key : str ) -> List [str ]:
346346 rels_config_fields : List [str ] = []
347347
348348 if any (x .has_rel_type () for x in rel_cols ):
@@ -351,7 +351,7 @@ def rels_config_part(self, rel_cols: List[EntityColumnSchema], properties_key: s
351351 )
352352
353353 if any (x .has_properties () for x in rel_cols ):
354- rels_config_fields .append (f"{ properties_key } : { properties_key } " )
354+ rels_config_fields .append (f"{ rel_properties_key } : { rel_properties_key } " )
355355
356356 return rels_config_fields
357357
0 commit comments