Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw warning when Polis API vote data doesn't match polismath data #33

Open
patcon opened this issue Mar 22, 2025 · 0 comments
Open

Throw warning when Polis API vote data doesn't match polismath data #33

patcon opened this issue Mar 22, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@patcon
Copy link
Member

patcon commented Mar 22, 2025

There are some odd edge-cases where votes don't show up in the polis API for a specific user. This means that the data_loader module builds a vote matrix that is slightly different than what the polismath server did calculations on.

The CSV export the /api/v3/math/pca2 endpoint show the results of full vote data, but the /api/v3/votes?conversation_id=foo&pid=123 endpoint for that user will show an empty list.

I'd like to have the polis data loader check the built vote_matrix counts against the polis math_data["user-vote-counts"] object, and throw a warning if they don't match, to keep people from wasting time.

Note: The perk of generating a vote_matrix from the API is that one doesn't need to have access to the report ID, or report page, nor an official data dump. If they have access to the public polis participation link, they can do analysis of the polis data. I'd like to preserve that benefit, but make sure we catch data integrity issues before wasting anyone's time.

We could also default to using the CSV endpoint whenever we're working from a report_id, as that seems to have more guarantees.

@patcon patcon added the bug Something isn't working label Mar 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant