From 59d67a116de1248946b9611fdc9734d0448c2a18 Mon Sep 17 00:00:00 2001 From: Ville Laitila Date: Wed, 26 Aug 2026 19:28:14 +0300 Subject: [PATCH] fix: NumPy 2.0 shim before spycy import in cypher tool spycy <= 0.0.3 references np.float_ (removed in NumPy 2.0), so sgraph_cypher_query crashes on toInteger/toFloat/toString. Restore the alias before importing sgraph.cypher/spycy; no-op on NumPy 1.x. Remove once sgraph ships softagram/sgraph#191 or spycy releases aneeshdurg/spycy#3. --- src/profiles/claude_code.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/profiles/claude_code.py b/src/profiles/claude_code.py index 2b5da83..15c751c 100644 --- a/src/profiles/claude_code.py +++ b/src/profiles/claude_code.py @@ -878,6 +878,16 @@ async def sgraph_cypher_query(input: CypherQueryInput): return {"error": f"Model '{mid}' not found"} try: + # NumPy 2.0 removed np.float_, which spycy <= 0.0.3 still + # references (toInteger/toFloat/toString crash without this). + # Same alias as np.float64 on NumPy 1.x, so a no-op there. + # Remove once sgraph ships its own shim (softagram/sgraph#191) + # or a spycy release containing aneeshdurg/spycy#3 is required. + import numpy as np + + if not hasattr(np, "float_"): + np.float_ = np.float64 # type: ignore[attr-defined] + from sgraph.cypher import SGraphCypherBackend, SGraphCypherExecutor import pandas as pd