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

Refactor Query/Flied classes .get_info and related methods for better programmatic use #76

Open
KonradUdoHannes opened this issue May 11, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@KonradUdoHannes
Copy link
Collaborator

Description

The Query class (and the related Field class) from the query_builder module has some functionality to display information about a query at hand and which fields,enums etc. one might add to it. A lot of this functionality is related to the .get_info method.
Currently this method prints the information to stdout when it is called. This has two main disadvantages.

  1. The method name is misleading as it doesn't "get" anything but instead "prints" something
  2. It's difficult to build applications on top of the query_builder class that make use of the .get_info information in their own way (i.e. don't do naive printing). Such an application could be a dashboard for data exploration.

I would suggest to refactor .get_info and related methods to return a data type, for instance a dict or a named tumple containing the information, such that it can be build upon. Addionally one could extend the Query/Field class to additionally retain its info printing funcitonality based on the new .get_info but under a different name. For instance .print_info.

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

2 participants