-
Notifications
You must be signed in to change notification settings - Fork 21
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
Query formatting and dependency tree/graph visualisation #805
Conversation
… of query attributes included in the resulting string
Codecov Report
@@ Coverage Diff @@
## master #805 +/- ##
=========================================
- Coverage 93.34% 93.14% -0.2%
=========================================
Files 130 130
Lines 6521 6552 +31
Branches 693 695 +2
=========================================
+ Hits 6087 6103 +16
- Misses 315 330 +15
Partials 119 119
Continue to review full report at Codecov.
|
Hmm, there is some alleged drop in coverage but I think this is due to codecov not picking up |
# Default representation, derived classes might want to add something more specific | ||
return format(self, "query_id") | ||
|
||
def __format__(self, fmt=""): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very neat :)
Closes #804.
Related to #786.
I have:
Description
This PR adds an optional argument
show_stored
toprint_dependency_tree()
which allows to display information on whether dependent queries have been stored:To implement this I also added a
Query.__format__
method which allows more convenient formatting of query objects by optionally specifying attributes that should be included in the resulting string, for example:Finally, since I already needed to copy & paste the example code from #786 a few times, I decided to wrap it up in a helper function
plot_dependency_tree()
which can plot a dependency graph in SVG or PNG format, so that it can be conveniently displayed in a Jupyter notebook.