fix: NumPy 2.0 compat shim for spycy in cypher module - #191
Merged
Conversation
spycy <= 0.0.3 references np.float_, removed in NumPy 2.0, so toInteger/toFloat/toString crash with AttributeError. Restore the alias (identical to np.float64 on NumPy 1.x) before importing spycy, with a regression test. Remove once a spycy release containing aneeshdurg/spycy#3 is required.
Softagram Impact Report for pull/191 (head commit: 709906f)TL;DR Arch. Impact: 1 | Changed code files: 2 | Directly impacted code files: 0⭐ Change Overview
🤖 AGENTS - machine-readable impact data (2 files changed, 0 impacted, +10/-0 deps)Change overviewHead Added dependencies (10)
Removed dependencies (0)None. Impacted files (0)None. Complete data
[] 📄 Full report
Impact Report explained. Give feedback on this report to support@softagram.com |
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
np.float_, removed in NumPy 2.0, so Cypher numeric functions (toInteger/toFloat/toString) and result conversion crash withAttributeErroron NumPy >= 2.0.sgraph.cyphernow restores the alias (np.float_ = np.float64) before importing spycy — a no-op on NumPy 1.x, where they were the same object. Marked for removal once a spycy release containing fix: NumPy 2.0 compatibility — replace removed np.float_ with np.float64 aneeshdurg/spycy#3 (the upstream one-line fix, submitted separately) is required.tests/test_cypher_numpy_compat.py, skipped when spycy is not installed) so a numpy/spycy upgrade cannot silently reintroduce the crash.Test Plan