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

400 Bad request on group by query #173

Open
geneorama opened this issue May 23, 2019 · 1 comment
Open

400 Bad request on group by query #173

geneorama opened this issue May 23, 2019 · 1 comment

Comments

@geneorama
Copy link
Member

q <- paste0("https://data.cityofchicago.org/resource/m6dm-c72p.json?",
            "$select=date_extract_y(trip_start_timestamp),",
            "date_extract_m(trip_start_timestamp),",
            "date_extract_d(trip_start_timestamp),",
            "count(trip_start_timestamp)&",
            "$group=date_extract_y(trip_start_timestamp),",
            "date_extract_m(trip_start_timestamp),",
            "date_extract_d(trip_start_timestamp)")
tab <- RSocrata::read.socrata(q)

results in

> tab <- RSocrata::read.socrata(q)
2019-05-23 09:15:00.397 getResponse: Error in httr GET: 400  https://data.cityofchicago.org/resource/m6dm-c72p.json?%24select=date_extract_y%28trip_start_timestamp%29%2Cdate_extract_m%28trip_start_timestamp%29%2Cdate_extract_d%28trip_start_timestamp%29%2Ccount%28trip_start_timestamp%29&%24group=date_extract_y%28trip_start_timestamp%29%2Cdate_extract_m%28trip_start_timestamp%29%2Cdate_extract_d%28trip_start_timestamp%29&$order=:id
Error in getResponse(validUrl, email, password) : Bad Request (HTTP 400).

This is my first time noticing the end of the query (the order=:id part), this is probably the issue. (before it was off the screen and I didn't see it!)

@geneorama
Copy link
Member Author

This works, and can be used to check the expected output:
jsonlite::fromJSON(readLines(q))

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

No branches or pull requests

1 participant