-
Notifications
You must be signed in to change notification settings - Fork 75
Improve rendering of ColumnGroup #1460
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
base: master
Are you sure you want to change the base?
Conversation
…e() to align rendering with column access and make it conform to the structure of data
For |
I agree with that, but the difference between a column group and a dataframe is that the former can have a name. That is not displayed anywhere in the output currently, but it's still valuable information. So while it could render like a dataframe, the name of the column group should still be visible, I think. I'm not sure whether we have such an ability in the current table output, but at least, rendering it as a DF with a single column group achieves this goal. |
Hmm, so you'd want to shadow the declared It would be a new concept for sure. We usually only change I'm not sure :) We need some more input. @AndreiKingsley @zaleslaw @koperagen what do you think? |
Fixes #1245
Swapping
is AnyCol
withis AnyFrame
allows to avoid applyingdataFrameOf()
to aColumnGroup
object whenconvertToDataFrame()
inKotlinNotebookPluginUtils
is called.In that case, a separate

ColumnGroup
object is rendered without the group,which might look a bit unusual, but the reason to implement it is to ensure more intuitive access to the columns (because we can only access columns
a
andb
and notletters
from the code; with the existing approach we would see the groupletters
, but would not be able to access it).Cast

asDataFrame
will leave it without the group being rendered:At the same time, if we convert this

ColumnGroup
object to a dataframe (with the functionpublic fun AnyBaseCol.toDataFrame(): AnyFrame = dataFrameOf(listOf(this))
, which is already present in the library), the group is rendered in the dataframe:This seems to be a correct result because in all cases rendering of the columns conforms to the way we access columns from the code (so the structure of data is reflected correctly), and column groups inside a dataframe are actually shown as groups, which prevents the user from being misled.