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

APIs not dealing with neighborhoods with commas in CSV format #3390

Closed
misaugstad opened this issue Sep 26, 2023 · 4 comments · Fixed by #3392
Closed

APIs not dealing with neighborhoods with commas in CSV format #3390

misaugstad opened this issue Sep 26, 2023 · 4 comments · Fixed by #3392
Assignees

Comments

@misaugstad
Copy link
Member

Brief description of problem/feature

@devonsnyder brought to my attention that the data looked messed up in CSV format for some data she was getting from our API (pic below). The reason is that the neighborhood is called "Little Italy, UIC"; there is a comma in the field for a CSV (comma-separated value) file.

Screenshot from 2023-09-26 16-32-05

Steps to reproduce

Here's the API call that @devonsnyder used:
https://sidewalk-chicago.cs.washington.edu/v2/access/attributes?lat1=41.863085&lng1=-87.661878&lat2=41.874468&lng2=-87.646729&filetype=csv

Potential solution(s)

I believe that the standard when your data could contain a comma is to surround it in double quotes. From what I can tell, the only data in our APIs that could have commas are the "Neighborhood Name" columns in /v2/access/attributes, /v2/access/attributesWithLabels, and /v2/access/score/neighborhoods. Should be pretty easy to update!

@davphan
Copy link
Collaborator

davphan commented Sep 27, 2023

While looking into this, it seems like /v2/access/score/neighborhoods is having an issue where the "coordinates" field somehow has a newline or something throwing off the csv file:
image
Can I make a new issue on this?

@misaugstad
Copy link
Member Author

@davphan is this after fixing the current issue you're still seeing this? If not, fix this issue first, and then make a new issue if it's still happening! This seems like the kind of thing that could be caused by the first issue!

@davphan
Copy link
Collaborator

davphan commented Sep 27, 2023

I reverted my changes and tried it and that issue still persists, so I figure it's something else? Would you rather I make a new issue for it or get it figured out in this same PR?

@misaugstad
Copy link
Member Author

Oh if it's happening without the changes you made to the code (or the database), then yes, make a new issue and work on that one next please!! If they are both easy/related changes, then I don't have an issue with them sharing a PR. Just depends on what makes sense / is easiest for you!

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

Successfully merging a pull request may close this issue.

2 participants