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

.results method does not return all regionss on second call #109

Open
ghost opened this issue Jul 30, 2020 · 1 comment
Open

.results method does not return all regionss on second call #109

ghost opened this issue Jul 30, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented Jul 30, 2020

  • Datenguide Python version: 0.3.1
  • Python version: all
  • Operating System: all

Description

When creating a query object with the .region factor method and more than one region, the .results method does
not return data for all regions on its second call and subsequent calls. It seems to be the case the the .results calls past the first only return results for the last region.

What I Did

from datenguidepy import Query

q = Query.region(['11', '09'])
stat = q.add_field('BEVSTD')
stat.add_args({'year': 1995})
first_call = q.results()
second_call = q.results()
print(first_call.shape[0],first_call.name.unique()) # 2 results, containing 'Berlin' and 'Bayern'
print(second_call.shape[0],second_call.name.unique()) # 1 result, only containing 'Bayern'
@KonradUdoHannes KonradUdoHannes added the bug Something isn't working label Jul 30, 2020
@EvgenyGorelov
Copy link

Solution: query_builder.py line 157 actually does not copy the object:

this_query_args = field.args

should be

this_query_args = field.args.copy()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants