Skip to content

Commit 81a775f

Browse files
lmeyerovclaude
andcommitted
fix(gfql): IS5 pandas tail passes StringDtype through (pandas 3 default str dtype)
CI py3.12/3.14 lanes run pandas 3, where every string column is the StringDtype-family 'str' dtype -- the extension-dtype decline disengaged the whole IS5 shape (engaged=0 in test_is5_shape_engages_and_matches). The rows-pivot preserves StringDtype on BOTH pandas 2 ('string') and pandas 3 ('str'), verified by differential in a pandas 3.0.3 env, so it passes through un-cast. Pinned. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y6dQEcjdazEnzuvuwf73ZL
1 parent 83db420 commit 81a775f

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

graphistry/compute/gfql_fast_paths.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1988,6 +1988,8 @@ def _execute_seeded_typed_hop_fast_path(
19881988
if prop == node:
19891989
continue
19901990
d = p_rows[prop].dtype
1991+
if isinstance(d, pd.StringDtype):
1992+
continue # pandas>=3 default str dtype: pivot preserves it (verified parity)
19911993
if not isinstance(d, np.dtype):
19921994
return None
19931995
if d == np.dtype(bool):

graphistry/tests/compute/gfql/test_seeded_typed_hop_fastpath.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -772,3 +772,18 @@ def test_engine_mismatch_declines(self):
772772
fast2, full2 = self._fast_and_full(self._typed_graph(), "polars", self.Q, expect_engage=False)
773773
assert type(fast2._nodes).__module__ == type(full2._nodes).__module__
774774
pd.testing.assert_frame_equal(_canon_nodes(fast2), _canon_nodes(full2))
775+
776+
def test_string_dtype_property_engages_and_matches(self):
777+
"""pandas StringDtype (explicit 'string' on pandas 2; the DEFAULT str dtype
778+
on pandas>=3) passes through the pivot unchanged on both versions —
779+
passthrough, engaged, exact dtype parity (CI py3.12/3.14 lanes run pandas 3,
780+
where declining str props would disengage the whole IS5 shape)."""
781+
g = self._typed_graph()
782+
ndf = g._nodes.copy()
783+
ndf["nm"] = pd.array(["a", "b", "c", "d", "e"], dtype="string")
784+
g = graphistry.nodes(ndf, "id").edges(g._edges, "src", "dst")
785+
q = ("MATCH (m:Message {id:10})-[{type:'HAS_CREATOR'}]->(p:Person) "
786+
"RETURN p.id AS pid, p.nm AS nm")
787+
fast, full = self._fast_and_full(g, "pandas", q)
788+
assert str(fast._nodes["nm"].dtype) == str(full._nodes["nm"].dtype)
789+
pd.testing.assert_frame_equal(_canon_nodes(fast), _canon_nodes(full))

0 commit comments

Comments
 (0)