-
Notifications
You must be signed in to change notification settings - Fork 90
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
Shortify group nodes representation #515
Conversation
21f50ec
to
f28aa33
Compare
I looked at panda`s data print, did not find convenient way to change how many rows to show, so I think this feature is not important.
|
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.
Just a couple of very minor requests.
compiler/quilt/nodes.py
Outdated
# strip last new line if needed | ||
if items[-1] == '\n': | ||
items.pop() | ||
# copare with + 1 helps to prevent hide under '...' only one item |
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.
Missing the m in compare.
compiler/quilt/nodes.py
Outdated
@@ -6,7 +6,7 @@ | |||
import pandas as pd | |||
from six import iteritems, string_types | |||
|
|||
from .tools import core | |||
from .tools import core, const |
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.
Maybe just import const.PRETTY_MAX_LEN?
f5457a0
to
85c8c4c
Compare
@kevinemoore Please, review this PR again. Thanks! |
items.append('\n') | ||
items += sorted(self._data_keys()) | ||
# strip last new line if needed | ||
if items[-1] == '\n': |
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.
This doesn't work for empty nodes
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.
Whoops, you are right, my bad.
Also it prints too many blank newlines in some cases. The PRETTY MAXLEN should also be much larger, like 100.
… On May 11, 2018, at 7:14 AM, Aleksandr Kurlov ***@***.***> wrote:
@kurlov commented on this pull request.
In compiler/quilt/nodes.py:
> @@ -61,11 +62,19 @@ class GroupNode(DataNode):
def __repr__(self):
pinfo = super(GroupNode, self).__repr__()
- group_info = '\n'.join(name + '/' for name in sorted(self._group_keys()))
- if group_info:
- group_info += '\n'
- data_info = '\n'.join(sorted(self._data_keys()))
- return '%s\n%s%s' % (pinfo, group_info, data_info)
+ items = [name + '/' for name in sorted(self._group_keys())]
+ if items:
+ items.append('\n')
+ items += sorted(self._data_keys())
+ # strip last new line if needed
+ if items[-1] == '\n':
Whoops, you are right, my bad.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Summary
Shortify nodes printing in case it exceeds limit.
Related to #493