Repository navigation
python-math #3: fix(delphi): cold-start generator copies FULL revote history (no DISTINCT ON dedup) - #2638
python-math #3: fix(delphi): cold-start generator copies FULL revote history (no DISTINCT ON dedup)#2638jucor wants to merge 1 commit into
Conversation
Delphi Coverage Report
|
There was a problem hiding this comment.
Pull request overview
This PR updates the Delphi cold-start generator to copy the full vote history (including revotes) without DISTINCT ON deduplication, while avoiding Postgres ON CONFLICT ... DO UPDATE cardinality violations caused by the votes insert rule. It also adds an opt-in integration test plus a shared Postgres provisioning helper to validate the behavior against a real migrated schema.
Changes:
- Update
copy_votes_with_fresh_timestampsto copy all vote rows in(created, ctid)order and suppress theon_vote_insert_update_unique_tablerule during the bulk insert. - Add an opt-in integration test that seeds revote history and asserts the copy preserves full row count and order with fresh timestamps.
- Add a
require_polis_postgres()test helper that provisions/validates a migrated Postgres (CI service or throwaway docker) for integration tests.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
delphi/scripts/generate_cold_start_clojure.py |
Copy full vote history (no dedup) and suppress the votes rule during the bulk insert to avoid ON CONFLICT cardinality errors. |
delphi/tests/test_generator_vote_copy.py |
New integration test for full-history vote copying (revotes preserved, order preserved, fresh timestamps). |
delphi/tests/conftest.py |
Adds shared Postgres provisioning/verification helper for opt-in integration tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…history (no DISTINCT ON dedup) commit-id:970c79cf
|
Closing: this change is already on This PR was one layer of a |
commit-id:970c79cf
Stack: