Skip to content

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

Open
@KonradUdoHannes

Description

@KonradUdoHannes
  • 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')

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions