Skip to content

Commit e7152a3

Browse files
lmeyerovclaude
andcommitted
test(gfql): assert dtype preservation against the input, not a hardcoded ns unit
The new named-fast-path dtype test hardcoded 'datetime64[ns]', but pandas 3.x (pandas==3.0.5 in the failing CI lanes) infers datetime64[us] from pd.to_datetime on date strings, so the INPUT itself is [us] and both the served lane and the policy-forced full path preserve it exactly. Assert what the test actually means: the served lane's dtype equals the input's and the full path's (and is a datetime64), pandas-version-agnostic. Verified green under both pandas 3.0.5 and pandas 2.2.3. Fixes red test-pandas-compat-gfql (latest, py3.14), test-core-python (3.13), and test-gfql-core (3.14) on the merge result with master (#1836/#1837). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011AB4RZpph3uSFUpzKnZJcr
1 parent 35ea421 commit e7152a3

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

graphistry/tests/compute/test_chain.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -987,8 +987,13 @@ def test_fast_path_named_datetime_categorical_columns_ride_along():
987987
full = g.gfql(ops, policy=_FAST_NOOP_POLICY)
988988
_assert_full_frame_value_parity(fast._nodes, full._nodes, ['v'])
989989
_assert_full_frame_value_parity(fast._edges, full._edges, ['s', 'd'])
990-
assert str(fast._nodes['ts'].dtype) == 'datetime64[ns]'
990+
# dtype preservation is asserted against the INPUT (and the full path), not a
991+
# hardcoded unit: pandas 2.x infers datetime64[ns] here, pandas 3.x datetime64[us]
992+
assert fast._nodes['ts'].dtype == nodes['ts'].dtype
993+
assert fast._nodes['ts'].dtype == full._nodes['ts'].dtype
994+
assert str(fast._nodes['ts'].dtype).startswith('datetime64[')
991995
assert str(fast._nodes['cat'].dtype) == 'category'
996+
assert fast._nodes['cat'].dtype == full._nodes['cat'].dtype
992997
# categorical seed filter: still served, same answer
993998
ops2 = [n({'cat': 'a'}, name='x'), e_forward(hops=1), n(name='y')]
994999
assert _try_chain_fast_path(g, ops2, Engine.PANDAS, None) is not None

0 commit comments

Comments
 (0)