Problem
The correlate_git_with_sessions() function in queries.py throws a TypeError when comparing timezone-aware and naive datetime objects. This happens when git commits have timezone information but session timestamps don't (or vice versa).
Current Workaround
Tests skip this case with pytest.skip():
try:
result = correlate_git_with_sessions.fn(days=7)
except TypeError:
pytest.skip("Timezone comparison issue in correlate_git_with_sessions")
Expected Behavior
The function should handle both timezone-aware and naive datetimes gracefully, either by:
- Normalizing all datetimes to UTC
- Stripping timezone info for comparison
- Making all timestamps timezone-aware
Files Affected
src/session_analytics/queries.py - correlate_git_with_sessions() function
tests/test_server.py:225-238 - test with skip workaround
tests/test_cli.py:626-630 - CLI test with skip workaround
Context
Discovered during test audit in PR #32.
Problem
The
correlate_git_with_sessions()function inqueries.pythrows aTypeErrorwhen comparing timezone-aware and naive datetime objects. This happens when git commits have timezone information but session timestamps don't (or vice versa).Current Workaround
Tests skip this case with
pytest.skip():Expected Behavior
The function should handle both timezone-aware and naive datetimes gracefully, either by:
Files Affected
src/session_analytics/queries.py-correlate_git_with_sessions()functiontests/test_server.py:225-238- test with skip workaroundtests/test_cli.py:626-630- CLI test with skip workaroundContext
Discovered during test audit in PR #32.