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
ENH: Add DataFrame tabular repr #1637
Conversation
@jcrist any comments on this? |
3beac48
to
bfc1856
Compare
Taking another look at this (sorry for the long silence). Some feedback based on the following example: Some subjective thoughts:
head = df.head(compute=False)
head.dask = head._optimize(head.dask, head._keys())
if len(head.dask) < 10:
... I'm not sure about this though. This sort of guess work can get us in trouble. Just throwing it out there as a thought. |
e4d417e
to
67f9e88
Compare
Sorry not to follow this up. updated based on your suggestions.
I think it's nice to display dask key name and number of tasks. Do we already have a function to count current tasks? |
I would just use |
Trying this out locally now. It feels very nice to me. |
Oh, and I see that it works nicely as a text repr as well. |
Ah you're right. I've tried to count something other than dask tasks. Fixed to include it to html / string repr. Note that |
|
||
@property | ||
def _repr_name(self): | ||
return self._name if len(self._name) < 10 else self._name[:7] |
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.
If we wanted to use more than 7 or 10 characters then we might want to use the dask.utils.key_split
function introduced in #1919 .
I've added the use of key_split to determine the name. Any objections @sinhrks ? I would like to merge this soon. |
thx, no objections of course:) |
Merged. Thanks @sinhrks ! I think this change will make several people happy. |
closes #1604. Fixed to be distinguishable from pandas output.