Repository navigation
Bump pandas 3.1.1, numpy 2.5.4, pytest 9.2.0; keep Cypher nulls null under pandas 3 - #227
Merged
villelaitila merged 2 commits intoNov 16, 2026
Conversation
spycy marks Cypher null with pd.NA and checks for it with `is pd.NA`. pandas 3 infers the str dtype for string columns, which stores a missing value as NaN, so a null that passes through a spycy table stops being null: IS NULL matches nothing, coalesce returns NaN, count counts it and the JSON output emits NaN. SGraphCypherExecutor.exec now turns future.infer_string off for the duration of the query and restores it afterwards. The option does not exist before pandas 2.1 (no-op there) and is deprecated in pandas 3, so its deprecation warning is suppressed. Add tests that lock in the pandas 2 null semantics.
Softagram Impact Report for pull/227 (head commit: 59d011e)TL;DR Arch. Impact: 📈 +32 | Changed code files: 3 | Directly impacted code files: 1⭐ Change Overview
🤖 AGENTS - machine-readable impact data (3 files changed, 1 impacted, +34/-1 deps)Change overviewHead Added dependencies (34)
Removed dependencies (1)
Impacted files (1)Unchanged files that directly depend on files changed in this PR - check them for behavioral impact. Grouped by changed file;
Suggested test targetsImpacted files that are test code — running or extending these covers the change most directly:
Complete data
📄 Full report
Impact Report explained. Give feedback on this report to support@softagram.com |
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.

Replaces the dependabot PRs #221 (pandas), #219 (pytest) and #217 (numpy) with one change that also fixes what pandas 3 breaks.
Pins (
requirements.txt)install_requiresis unchanged (pandas>=1.5.3, no numpy), so downstream users can stay on pandas 2.Fix: Cypher nulls under pandas 3
The suite passed on the new pins as it was, but Cypher queries gave wrong answers whenever a value is null. spycy marks Cypher
nullwithpd.NAand checks it withvalue is pd.NA; pandas 3 infers thestrdtype for string columns, which stores a missing value asNaN, so a null that passes through a spycy table stops being null:IS NULL(afterWITH … WHERE, afterOPTIONAL MATCH) matches nothing;coalesce(f.extra, 'none')returns NaN;count(f.extra)counts the null;size()raises;NaN, which is not valid JSON.SGraphCypherExecutor.execnow runs withfuture.infer_stringturned off and restores it afterwards. The option does not exist before pandas 2.1 (no-op there); pandas 3 deprecates it, and only that deprecation message is suppressed. With the fix, the probe queries give identical results on pandas 3.1.1 and 2.3.3.tests/test_cypher_null_semantics.py(8 tests): 7 fail on pandas 3.1.1 without the fix, all 8 pass on pandas 2.3.3 with or without it.Limits: the option is process-wide (a concurrent thread sees it during a query), and pandas 4 is to remove it, after which these tests fail again. The lasting fix belongs in spycy (object columns or
pd.isna); spycy also emits two pandas 3 deprecations (sort_values(inplace=…),reset_index(inplace=…)), which are the 7 warnings left in the suite.Testing (Python 3.12.7,
PYTHONPATH=src)attributequeries.py, the other pandas user, gives identical values and types on both pandas versions (only the column dtype label changes, and the code usesto_dict()). No removed numpy API is used; thenp.float_shim incypher.pystill works on 2.5.4. flake8: no new findings.Downstream (softagram-live)
softagram-live is already on pandas 3.0.0 and does not import
sgraph.cypher, so this release changes nothing there by itself. Its own numpy cannot follow to 2.5 yet: it pinsscipy==1.15.3, which requiresnumpy<2.5; moving needs scipy ≥ 1.16 as one numeric-stack change.