Skip to content

Commit

Permalink
removed superfluous key removals in ancestor, parent, children, desce…
Browse files Browse the repository at this point in the history
…ndants now that this is handled in the query directly
  • Loading branch information
DerekFurstPitt committed Jan 16, 2025
1 parent a852db5 commit 4ae38a8
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions src/schema/schema_neo4j_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,7 @@ def get_children(neo4j_driver, uuid, property_key = None):
else:
# Convert the list of nodes to a list of dicts
results = nodes_to_dicts(record[record_field_name])
if fields_to_omit:
for node_dict in results:
for field in fields_to_omit:
node_dict.pop(field, None)

return results


Expand Down Expand Up @@ -248,10 +245,6 @@ def get_parents(neo4j_driver, uuid, property_key = None):
else:
# Convert the list of nodes to a list of dicts
results = nodes_to_dicts(record[record_field_name])
if fields_to_omit:
for node_dict in results:
for field in fields_to_omit:
node_dict.pop(field, None)

return results

Expand Down Expand Up @@ -417,11 +410,6 @@ def get_ancestors(neo4j_driver, uuid, property_key = None):
# Convert the list of nodes to a list of dicts
results = nodes_to_dicts(record[record_field_name])

if fields_to_omit:
for node_dict in results:
for field in fields_to_omit:
node_dict.pop(field, None)

return results

"""
Expand Down Expand Up @@ -472,10 +460,7 @@ def get_descendants(neo4j_driver, uuid, property_key = None):
else:
# Convert the list of nodes to a list of dicts
results = nodes_to_dicts(record[record_field_name])
if fields_to_omit:
for node_dict in results:
for field in fields_to_omit:
node_dict.pop(field, None)

return results


Expand Down

0 comments on commit 4ae38a8

Please sign in to comment.