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

API returns different result than the one displayed on the API page #1412

Closed
abhcs opened this issue Feb 23, 2024 · 6 comments · Fixed by #1465
Closed

API returns different result than the one displayed on the API page #1412

abhcs opened this issue Feb 23, 2024 · 6 comments · Fixed by #1465

Comments

@abhcs
Copy link
Collaborator

abhcs commented Feb 23, 2024

For the example input, the snap computed by the API is 2833.5. On running the same example locally, I get

{
    "message": null,
    "result": {
        "people": {
            "child": {
                "age": {
                    "2024": 5
                }
            },
            "parent": {
                "age": {
                    "2024": 30
                },
                "employment_income": {
                    "2024": 20000
                }
            }
        },
        "spm_units": {
            "spm_unit": {
                "members": [
                    "parent",
                    "child"
                ],
                "snap": {
                    "2024": 2334.0
                }
            }
        }
    },
    "status": "ok"
}

Expected

The outputs should be consistent.

@MaxGhenis
Copy link
Contributor

While we're fixing this let's also specify the state_code since it affects the amount

@anth-volk
Copy link
Collaborator

When running this in a Colab setup, I receive the same 2334.0

@abhcs
Copy link
Collaborator Author

abhcs commented Feb 28, 2024

@anth-volk as you should but the value displayed on the API doc page under output format is 2833.5. I am just clarifying because the description of the issue is a little confusing.

@anth-volk
Copy link
Collaborator

@abhcs Yeah, I'm only confirming that I reproduced what you saw, as I was worried there was some underlying bug in the API or in our API call. Turns out the reason this occurs is because the response is hard-coded into the page - there's no API call at all, hence the confusingly different value.

@anth-volk
Copy link
Collaborator

@abhcs I can take this bug, as well as a couple others on the API page, if you would rather work on something else, as I think some visual fixes are also in order. That said, since you identified them first, I'm happy to step aside if you'd prefer to work on them.

@abhcs
Copy link
Collaborator Author

abhcs commented Feb 28, 2024

Please go ahead! (I usually just assign myself the issue when I want to work on it immediately.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed
Development

Successfully merging a pull request may close this issue.

3 participants