Skip to content

fix(gfql): preserve timezone-aware temporal equality - #2234

Merged
lmeyerov merged 4 commits into
masterfrom
fix/gfql-tz-aware-filter-equality
Oct 24, 2026
Merged

lmeyerov merged 4 commits into
masterfrom
fix/gfql-tz-aware-filter-equality

Conversation

@lmeyerov

@lmeyerov lmeyerov commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Tests

  • Compact R1 matrix covers literal, parameter, and serialized JSON forms; UTC/non-UTC midnight; equivalent offsets; wrong-instant, noon, and next-day negatives; ambiguous/nonexistent bounds; null-only and empty typed frames.
  • python -m pytest -q graphistry/tests/compute/gfql/test_temporal_leak_family_1915.py graphistry/tests/test_compute_filter_by_dict.py -k 'not cudf' --no-header → 95 passed, 21 deselected.
  • ruff check graphistry/compute/filter_by_dict.py graphistry/tests/compute/gfql/test_temporal_leak_family_1915.py → passed.
  • python -m mypy graphistry/compute/filter_by_dict.py graphistry/tests/compute/gfql/test_temporal_leak_family_1915.py → same 14 pre-existing errors.
  • DGX cuDF 26.02.01, exact tracked source at fdb24db92e0db93c7f98dc650b74fb4fb0cd1432 → 116 passed, 0 skipped.
  • Exact-head CI run 40053270807, CodeQL, and RTD are green.

@lmeyerov
lmeyerov force-pushed the fix/gfql-tz-aware-filter-equality branch 3 times, most recently from d169d26 to 8c2ef94 Compare October 24, 2026 03:02
@lmeyerov
lmeyerov force-pushed the fix/gfql-tz-aware-filter-equality branch 2 times, most recently from 59d6f6e to d1a27c4 Compare October 24, 2026 04:29
@lmeyerov
lmeyerov force-pushed the fix/gfql-tz-aware-filter-equality branch from d1a27c4 to ef1b617 Compare October 24, 2026 04:44
@aucahuasi

Copy link
Copy Markdown
Contributor

I tested this branch at d1a27c40b against the repro in #2235. Setup: pandas 3.0.6, Python 3.12, default (pandas) engine, strict=True. The comparison runs used the same environment with 0.61.1 and 0.61.2.

Equality is fixed, once pytz is installed:

Column tz Query 0.61.2 this branch
UTC n.ts = '2024-01-01' [] [a]
UTC n.ts = '2024-01-01T00:00:00' [] [a]
UTC JSON filter_dict {"ts": "2024-01-01"} [] [a]
America/New_York n.ts = '2024-01-01' [] [a] (midnight local)
America/New_York n.ts = '2024-01-01T05:00:00' [] [c] (05:00 local)
America/New_York n.ts = '2024-01-01T05:00:00Z' [a] [a] (instant)
America/New_York MATCH (n {ts: '2024-01-01'}) [] [a]

Timezone-naive columns and <> are unchanged.

1. pytz is not a declared dependency. Without it, the fixed path raises instead of matching:

MATCH (n) WHERE n.ts = '2024-01-01' RETURN n.nid AS id
-> ModuleNotFoundError: No module named 'pytz'

(JSON filter_dict raises the same.)

  • Where: filter_by_dict.py:44 does import_module("pytz.exceptions").
  • Why it's missing: pandas 3 lists pytz only under its timezone/all extras, and graphistry's metadata doesn't require it. A pandas 2.x CI environment hides this, because pandas 2 still depends on pytz.
  • Suggested fix: import pytz lazily with a fallback, catching the exceptions pandas itself raises for ambiguous or nonexistent local times, or add pytz as a dependency.

2. IN / IsIn with offset-less strings still match nothing on tz-aware columns. This is pre-existing, the same on 0.61.1, 0.61.2 and this branch:

Column tz Query all three versions
UTC n.ts IN ['2024-01-01', '2024-02-01'] [] (expected [a, b])
UTC JSON {"type": "IsIn", "options": ["2024-01-01", "2024-02-01"]} []
UTC n.ts IN ['2024-01-01T00:00:00Z'] [a] (correct)

It's the same localization gap as equality, so it might be worth covering here too.

The other items in #2235 (2 to 7) are unchanged on this branch, as expected.

@lmeyerov
lmeyerov merged commit 5cb023e into master Oct 24, 2026
85 checks passed
@lmeyerov
lmeyerov deleted the fix/gfql-tz-aware-filter-equality branch October 24, 2026 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GFQL 0.61.2: timezone-aware datetime equality loses matches for plain date strings

2 participants