Repository navigation
Conversation
[Medium impact] The behavior change is limited to bucket CSV downloads. Fix the large-integer export failure before merging. Findings
SummaryThe PR preserves legacy non-object event data by choosing a JSON
Reviews (3) · Last reviewed commit: "fix(export): keep numeric JSON cells un-..." · Reviewed by Greptile |
|
CI-green and mergeable — waiting only on a maintainer click. This PR is ready to merge, but the bot has pull-only access to this repo and can't self-merge — surfacing it here so it isn't lost. The monitoring loop will stop re-flagging it now that this note is posted. |
🤖 AI code reviewThe PR changes Safe to merge — no P0/P1 findingsConfidence 5/5 ✅ No findings. The diff looks correct to me on this pass. Files changed (3) — the diff as I read it
Previous review passes
Reviewed Maintainer commands
|
Use the existing JSON-column fallback before key discovery whenever a stored payload is not an object. Preserve every row without changing ingestion or historical data; cover streamed Flask responses and object-only compatibility. Git-Session-Id: 01c28659-e76d-44c6-aa3a-ef006c0b6f44
d7eba98 to
5faf152
Compare
|
Rebased onto master Verification after rebase: native |
This comment has been minimized.
This comment has been minimized.
Formula neutralization prefixed ' to negative numbers such as -5, so a scalar data cell no longer round-tripped through json.loads. Finite JSON numbers are now exported unchanged; strings that look like formulas are still neutralized. Git-Session-Id: 7044b809-3df1-480f-88a9-e5e27e03138f
|
@greptileai review |
| text = json.dumps(value, separators=(",", ":"), ensure_ascii=False) | ||
| # Keep -5 / -1.5 as valid JSON numbers; a leading "'" would break json.loads. | ||
| is_number = isinstance(value, (int, float)) and not isinstance(value, bool) | ||
| if is_number and math.isfinite(value): |
There was a problem hiding this comment.
Large integers stop CSV downloads
_json now calls math.isfinite on integers, which raises OverflowError for valid JSON integers such as 10**400. An event with data={"n": 10**400} therefore stops a CSV export after the header, even though json.dumps can preserve the value.
Treat integers as finite directly and call math.isfinite only for floats. Add a large-integer regression.
| if is_number and math.isfinite(value): | |
| if is_number and (isinstance(value, int) or math.isfinite(value)): |
Problem
Previously accepted list/scalar event payloads break the entire CSV stream. A list payload produces HTTP 200 headers and then
AttributeError: list has no getwhile consuming the body; numeric/boolean payloads fail during key discovery.Change
datacolumn before key discovery whenever any exported event has non-object data.make test.Verification
make test: 156 passed.Coordination
#201 changes exact JSON archives and #173 changes performance; neither edits csv_export.py. Their Makefile test-list edits may need reconciliation. Maintainer merge and regression replay on master remain outstanding.