fix: send batch sent_at in snake case#676
Merged
Merged
Conversation
Contributor
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
posthog/test/test_request.py:114-130
**Test not parameterised**
The team rule prefers parameterised tests. The two assertions here — `"sent_at"` must be present and `"sentAt"` must be absent — are independent enough to express as a `@pytest.mark.parametrize` table, which also makes it easy to extend the key allow/deny list without duplicating the mock setup.
Reviews (1): Last reviewed commit: "fix: send batch sent_at in snake case" | Re-trigger Greptile |
Contributor
posthog-python Compliance ReportDate: 2026-06-18 12:31:04 UTC ✅ All Tests Passed!45/45 tests passed Capture Tests✅ 29/29 tests passed View Details
Feature_Flags Tests✅ 16/16 tests passed View Details
|
954f92b to
dd14841
Compare
Contributor
|
Reviews (2): Last reviewed commit: "address pr review feedback" | Re-trigger Greptile |
|
CI is not happy here? |
Member
Author
blocked by #677 which is now merged and ok |
ioannisj
approved these changes
Jun 18, 2026
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.
💡 Motivation and Context
Python SDK batch requests currently send the top-level client submission timestamp as
sentAt, but the batch ingestion backend readssent_at. As a result, the backend ignores the value and skips clock-skew correction that depends on the batch-level sent timestamp.This includes a patch changeset for
pypi/posthog.💚 How did you test it?
uv run pytest posthog/test/test_request.py -q📝 Checklist
If releasing new changes
sampo addto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
This PR was authored with Pi. The backend batch endpoint was cross-checked and found to deserialize
sent_at, so the SDK was updated to emit the backend-supported snake_case field. A parameterized regression test ensuressent_atis present and the oldsentAtkey is absent. The changeset targetspypi/posthog.