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

Fixes various street and neighborhood API bugs #3033

Merged
merged 6 commits into from
Sep 19, 2022

Conversation

misaugstad
Copy link
Member

@misaugstad misaugstad commented Sep 19, 2022

Resolves #3032
Resolves #974

This fixes a few bugs introduced by our recent PRs in the /v2/access/score/streets and /v2/access/score/neighborhoods APIs, particularly on streets with no label data.

Here's a mostly comprehensive list of bugs I found. All of these are new as of the most recent version.

  • There were cases where we were returning duplicate attributes in the attributes and attributesWithLabels endpoints
  • If there are no labels on a street/neighborhood, we were returning an incorrect timestamp. Now we are just returning null
  • If a street or neighborhood had no labels, sometimes there would just be a server error
  • For the streets API, we were computing the average image and label age based on any type of label on the street, whereas AccessScore only uses our four primary label types. We now only include the four primary label types in this calculation.

In addition, instead of saying whether a street has been audited, we now say how many audits the street has had (there are zero audits if it is unaudited).

And finally, I cleaned up the code to hopefully prevent further mistakes in the API, mostly by reusing more code!

Before/After screenshots (if applicable)

Before (streets API)
Screenshot from 2022-09-19 15-38-38

After
Screenshot from 2022-09-19 13-52-47

Things to check before submitting the PR
  • I've written a descriptive PR title.
  • I've added/updated comments for large or confusing blocks of code.
  • I've included before/after screenshots above.

@misaugstad misaugstad self-assigned this Sep 19, 2022
@misaugstad misaugstad merged commit 175d0a7 into develop Sep 19, 2022
@misaugstad misaugstad deleted the 3032-fix-api-null-pointer-bug branch September 19, 2022 22:48
@misaugstad misaugstad mentioned this pull request Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API request error after latest release Backfill label table with timestamp of the creation date/time
1 participant