Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add utility functions for removing nodes from catalogue graph #2850

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
Apply auto-formatting rules
weco-bot committed Mar 10, 2025
commit 081468d6a54fb81b9bd8bf73aa5bcc6a9cfdf62f
3 changes: 2 additions & 1 deletion catalogue_graph/src/clients/base_neptune_client.py
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@

DELETE_BATCH_SIZE = 10000


def on_request_backoff(backoff_details: typing.Any) -> None:
exception_name = type(backoff_details["exception"]).__name__
print(f"Neptune request failed due to '{exception_name}'. Retrying...")
@@ -193,5 +194,5 @@ def delete_all_nodes_with_label(self, label: str) -> None:
MATCH (n:{label}) WITH n ORDER BY n.id LIMIT {DELETE_BATCH_SIZE} DETACH DELETE n;
"""
self.run_open_cypher_query(delete_query)

print(f"Removed all nodes with label '{label}'.")