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

Raise a more meaningfull error when an invalid field is specified. #101

Open
KonradUdoHannes opened this issue Jul 4, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@KonradUdoHannes
Copy link
Collaborator

  • Datenguide Python version: 0.3.0
  • Python version: All
  • Operating System: All

Description

When specifying an invalid field in the query builder this raises a key error. This could raise a more descriptive error (maybe KeyError or ValueError) that makes it explicit that the field is not a valid sub field of its parent. It could also point towards the available fields/ the get_info function that returns this information to the user.

What I Did

from datenguidepy.query_builder import Query

q = Query.region('01')
q.add_field('NOT_VALID')

# Example on a different hierarchy level
q = Query.region('11')
s = q.add_field('BEVSTD')
s.add_field('ANOTHER_INVALID_FIELD')
@KonradUdoHannes KonradUdoHannes added the enhancement New feature or request label Jul 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant