Repository navigation
fix(export): prefix CSV data keys that collide with id/timestamp/duration - #184
TimeToBuildBob wants to merge 1 commit into
Conversation
|
|
Status check: Greptile reviewed at 5/5 (no actionable issues). CI: ubuntu, windows, lint, format, and typecheck all pass. macOS runner has been queued/running for ~1.5h — appears slow on GitHub's side, not a test failure. Ready for maintainer review and merge when macOS finishes. |
|
CI-green and mergeable (Greptile 5/5) — 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 reviewThis PR changes the CSV export header generation in aw_server/csv_export.py by adding a _header_names() function that prefixes data keys colliding with the fixed id/timestamp/duration columns (or with earlier data keys) with a repeated 'data.' prefix until unique. The events_to_csv() function now uses this for the header row, while values are still read by the original data key. Two tests are added: an API round-trip test for colliding keys and a unit test for the prefix-repeats-until-unique behavior. Safe to merge — no P0/P1 findingsConfidence 5/5 ✅ No findings. The diff looks correct to me on this pass. Files changed (2) — the diff as I read it
Previous review passes
Reviewed Maintainer commands
|
1221313 to
1d2e926
Compare
|
The conflict is already resolved in |
…tion A data key named id, timestamp or duration produced a duplicate header name. Prefix such keys with "data." (repeated until unique), matching ActivityWatch/aw-server-rust#795. Values are still read by the original key. Git-Session-Id: 838c
1d2e926 to
4f031cd
Compare
|
Rebased onto current master and pushed Verification: the five test modules used by |
Follow-up to the Greptile note on #178: the bucket CSV export (#179) writes
id,timestamp,durationfollowed by the union of event data keys, so a data key namedid,timestampordurationproduced a duplicate header name.A data key that would repeat an earlier header name now gets a
data.prefix, repeated until unique (duration→data.duration;idnext to a literaldata.id→data.data.id). Only the header changes; values are still read by the original key. Non-colliding keys and the >32-key singledatacolumn are unchanged. Same scheme as ActivityWatch/aw-server-rust#795, so both servers keep emitting the same header.Tests:
test_export_bucket_csv_prefixes_colliding_data_keys(API round-trip) andtest_csv_header_prefix_repeats_until_unique;tests/test_server.py15 passed, ruff and mypy clean.