PolicyEngine / policyengine-api

PolicyEngine's REST API for computing policy impacts.
GNU Affero General Public License v3.0
7 stars 19 forks source link

Repair `get_analysis` endpoint #1513

Closed anth-volk closed 1 month ago

anth-volk commented 1 month ago

Fixes #1510.

Currently, the API's get_analysis endpoint passes a single argument into the PolicyEngineDatabase.query() statement that runs on the deployed database. However, this argument is a string, while the deployed database calls for a list and the local database that runs alongside it (and which we use to debug) calls for a tuple.

I'm not entirely sure why this wasn't a problem with our prior ChatGPT implementation, but I have a few theories that I won't expound on here. Either way, it seems to be a bigger issue with the deployed MySQL database than the local SQLite one, so the below video demonstrates the code working with the deployed database:

https://github.com/PolicyEngine/policyengine-api/assets/14987227/02fa0de3-460b-4243-b927-1e112559e699