Upload scripts/ingest_epoch.py with huggingface_hub
Browse files- scripts/ingest_epoch.py +6 -6
scripts/ingest_epoch.py
CHANGED
|
@@ -878,9 +878,9 @@ def merge_neo4j_epoch_dump(epoch: int, dump_path: Path, dry_run: bool = False) -
|
|
| 878 |
"RETURN DISTINCT source, target, timestamp"
|
| 879 |
)
|
| 880 |
merge_query = (
|
| 881 |
-
|
| 882 |
-
"MERGE (a:Wallet {
|
| 883 |
-
"MERGE (b:Wallet {
|
| 884 |
f"MERGE (a)-[r:{rel_type}]->(b) "
|
| 885 |
"ON CREATE SET r.timestamp = t.timestamp "
|
| 886 |
"ON MATCH SET r.timestamp = CASE WHEN t.timestamp < r.timestamp THEN t.timestamp ELSE r.timestamp END"
|
|
@@ -909,9 +909,9 @@ def merge_neo4j_epoch_dump(epoch: int, dump_path: Path, dry_run: bool = False) -
|
|
| 909 |
"RETURN DISTINCT source, target, timestamp"
|
| 910 |
)
|
| 911 |
merge_query = (
|
| 912 |
-
|
| 913 |
-
"MERGE (w:Wallet {
|
| 914 |
-
"MERGE (k:Token {
|
| 915 |
f"MERGE (w)-[r:{rel_type}]->(k) "
|
| 916 |
"ON CREATE SET r.timestamp = t.timestamp "
|
| 917 |
"ON MATCH SET r.timestamp = CASE WHEN t.timestamp < r.timestamp THEN t.timestamp ELSE r.timestamp END"
|
|
|
|
| 878 |
"RETURN DISTINCT source, target, timestamp"
|
| 879 |
)
|
| 880 |
merge_query = (
|
| 881 |
+
"UNWIND $rows AS t "
|
| 882 |
+
"MERGE (a:Wallet {address: t.source}) "
|
| 883 |
+
"MERGE (b:Wallet {address: t.target}) "
|
| 884 |
f"MERGE (a)-[r:{rel_type}]->(b) "
|
| 885 |
"ON CREATE SET r.timestamp = t.timestamp "
|
| 886 |
"ON MATCH SET r.timestamp = CASE WHEN t.timestamp < r.timestamp THEN t.timestamp ELSE r.timestamp END"
|
|
|
|
| 909 |
"RETURN DISTINCT source, target, timestamp"
|
| 910 |
)
|
| 911 |
merge_query = (
|
| 912 |
+
"UNWIND $rows AS t "
|
| 913 |
+
"MERGE (w:Wallet {address: t.source}) "
|
| 914 |
+
"MERGE (k:Token {address: t.target}) "
|
| 915 |
f"MERGE (w)-[r:{rel_type}]->(k) "
|
| 916 |
"ON CREATE SET r.timestamp = t.timestamp "
|
| 917 |
"ON MATCH SET r.timestamp = CASE WHEN t.timestamp < r.timestamp THEN t.timestamp ELSE r.timestamp END"
|