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

Can we get a limited, counted set of cases? #4

Open
gsf opened this issue Dec 2, 2012 · 11 comments
Open

Can we get a limited, counted set of cases? #4

gsf opened this issue Dec 2, 2012 · 11 comments

Comments

@gsf
Copy link
Collaborator

gsf commented Dec 2, 2012

The "cases" type currently hits http://services.phila.gov/PhillyApi/Data/v0.7/Service.svc/violationdetails, which is busted if you try to pass "$top" or "$inlinecount". Is there a way to limit and get counts for the preview?

@timwis
Copy link
Collaborator

timwis commented Dec 4, 2012

@mdb
Copy link
Owner

mdb commented Dec 4, 2012

@timwis Your URL works for me.

@gsf Does @timwis's response address your question? Is this an invalid issue?

@mdb
Copy link
Owner

mdb commented Dec 9, 2012

@timwis While your URL works for me, I've observed the following. Am I missing something obvious?

Does not work:
http://services.phila.gov/PhillyApi/Data/v0.7/Service.svc/violationdetails?$format=json&$expand=cases,locations&$top=&$inlinecount=

Works:
http://services.phila.gov/PhillyApi/Data/v0.7/Service.svc/violationdetails?$format=json&$top=&$inlinecount=

I think we're a bit confused as to when we should be including $expand=cases,locations. Currently, we include this on every getCases call, yet its inclusion seemingly results in a timeout.

Could you please clarify?

@timwis
Copy link
Collaborator

timwis commented Dec 9, 2012

Interesting...so you can either include the &$expand= or the &$top= but when you include both it times out. I could have sworn I tested this before and it worked. I can report this as a bug then. Before I do, are there any other bugs you've come across that I should include?

@mdb
Copy link
Owner

mdb commented Dec 9, 2012

@timwis Actually, I'm not sure if $expand=cases,locations works at all, unless I'm mistaken.

For example, even the following -- which has no $top -- seemingly does not work:
http://services.phila.gov/PhillyApi/Data/v0.7/Service.svc/violationdetails?$format=json&$expand=cases,locations

I was fairly sure we tested too.

And just to clarify, the end goal here is to write a 'getCases' method that returns cases as we discussed at RHoK. If I'm off-base, please steer me back on course; I'm not sure I ever fully grokked cases to begin with.

@timwis
Copy link
Collaborator

timwis commented Dec 20, 2012

FYI, I've submitted this ticket to our support system in the City. Before I did it, though, I think I narrowed it down further. The issue is not to do with the $top parameter; rather with expanding cases.

It seems like whenever we expand cases, it often leads to a timeout. For instance, this always times out:
http://services.phila.gov/PhillyApi/Data/v0.7/Service.svc/violationdetails?$format=json&$filter=locations/census_tract%20eq%20'162'&$expand=cases&$top=5

But when we expand locations instead of cases, it works fine:
http://services.phila.gov/PhillyApi/Data/v0.7/Service.svc/violationdetails?$format=json&$filter=locations/census_tract%20eq%20'162'&$expand=locations&$top=5

@mdb
Copy link
Owner

mdb commented Dec 22, 2012

Great - thanks Tim. I'll stay posted.

@mdb
Copy link
Owner

mdb commented Jan 6, 2013

@timwis - Do you have any update on this? Thanks.

@timwis
Copy link
Collaborator

timwis commented Feb 6, 2013

Mike, I followed up on this on 1/16, and could have sworn I replied here to let you know. My bad. I just followed up again today. The latest status is:

The expand part of the URI query works as expected:

http://services.phila.gov/PhillyApi/Data/v0.7/Service.svc/violationdetails?$format=json&$filter=locations/census_tract%20eq%20'162'&$expand=cases

The timeout occurs when top 5 records are requested when specifying the "top" operator.

The are investigating what's causing this behavior, and keep you informed of our findings.

@mdb
Copy link
Owner

mdb commented Feb 6, 2013

Great - thanks Tim. I'll stay posted.

@caseycesari
Copy link
Collaborator

@timwis any update on this? Was using the API recently and noticed that for permits, $expand=locations, works fine, but if you try and $expand=zoningboardappeals or $expand=buildingboardappeals, both of which are 'deferred' properties on a permit, you get an Oracle error. For example:

Works: http://services.phila.gov/PhillyAPI/Data/v0.7/Service.svc/permits('333274')?$expand=locations

Doesn't work: http://services.phila.gov/PhillyAPI/Data/v0.7/Service.svc/permits('333274')?$expand=zoningboardappeals

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

4 participants