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

Empty Query #75

Open
julianv95 opened this issue Apr 29, 2020 · 5 comments
Open

Empty Query #75

julianv95 opened this issue Apr 29, 2020 · 5 comments
Assignees

Comments

@julianv95
Copy link

  • Datenguide Python version: 0.1.2 and 0.2.0
  • Python version: 3.7.5
  • Operating System: macOS Sierra 10.12.6

Description

I tried to request the census data grouped by age for a single city. As a result i get a an empty query. I played around for a bit and discovered, that for the age groups none of the enum values besides "GESAMT" are working. The enum "GES" works fine with all three of its values.
Maybe this isn't a bug at all and i just made a mistake but i don't know what to try next.

I tried version 0.2.0 and 0.1.2 and got the exact same result.

What I Did

query = Query.region('08226098')
field = query.add_field('BEVSTD') 
#field.add_args({'year': [2018]})
field.add_args({'ALTX20': 'ALT045B50'}) # this doesn't work
#field.add_args({'GES': 'GESW'}) # this does work
field.get_info()

df = pd.DataFrame(query.results())
@enryH
Copy link
Collaborator

enryH commented Apr 30, 2020

Hey,
it might be that the underlying data you request does not exist. You can Query the total for ALTX20, but not the sub-categories.

@KonradUdoHannes: It has nothing to do with the lastest bug-fixes on multiple enums. Any further ideas?

from datenguidepy import Query

query = Query.region('08226098')
field = query.add_field('BEVSTD') 
field.add_args({'year': [2018]})
#field.add_args({'ALTX20': 'ALT045B50'}) # this doesn't work
field.add_args({'ALTX20': 'GESAMT'}) # this does work
#field.add_args({'GES': 'GESW'}) # this does work
field.get_info()

query.results() # Returns a pandas.DataFrame

Best, Henry

@KonradUdoHannes
Copy link
Collaborator

In general I would always assume that the data is simply not present. This is the general Issue that we don't have a good overview of what data is available and what data isn't. That's why Michelle is working on such an overview. In this particular case I checked with the web api and also did not get any data as expected. Although I was not able to fetch data for the different members of 'GES'. And I only get 'GESAMT' for both enums.
Generally I would suspect that with the cube structure of the original data enums (dimensions in cube terminology) need to be created if only some of the regions provide details for them.

When in doubt about the availability of data the query object should be able to provide you with the query itself (maybe as private function), which one could send to the web api in a browser.

@julianv95
Copy link
Author

Thanks for the fast replies!

@KonradUdoHannes
I only checked the availability of the data via the Web-GUI of regionalstatistik.de and this shows me that the data for the given query is available.
So what you are saying means that you can't query all of the data shown in the Web-GUI even with the official api, or are you reffering to the datengui web api?

Best, Julian

@enryH
Copy link
Collaborator

enryH commented Apr 30, 2020

I guess the ladder, see Datengui Web GraphQL API.

@KonradUdoHannes
Copy link
Collaborator

@julianv95 Thanks for the feedback. It appears quite strange, and it might be a bug with regard to the snapshot that datenguide makes from regionalstatistik.de to feed the API with data. Strangely enough one region hierarchy higher, .i.e. '08226' still seems to work but the other data is not provided by the Datenguide. Generally data that is found on regionalstatsitik should also be available in the API and as far as I understand the make a fresh snapshot on a daily basis.

I'll try to figure out whether it relates to known issues on their side.

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

3 participants