Skip to content

Change default flatten parent-child separator to "_" #920

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

Merged
merged 2 commits into from
Oct 16, 2024

Conversation

Jolanrensen
Copy link
Collaborator

Fixes #911

While the discussion of separators in generated accessors is for later, this PR at least fixes the case for flatten.

Given a DataFrame with df.group.child1 and df.group.child2. Calling flatten with keepParentNameForColumns will introduce flatDf.group_child1 and flatDf.group_child2 by default now.

This makes it a bit easier compared to the previous default with "." which made the flattened column name "group.child1" and the accessor flatDf`.`group child1`.

@@ -9,37 +9,41 @@ import org.jetbrains.kotlinx.dataframe.columns.toColumnSet
import org.jetbrains.kotlinx.dataframe.impl.api.flattenImpl
import kotlin.reflect.KProperty

public const val FLATTEN_DEFAULT_SEPARATOR: String = "_"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes parameter info popup less informative. I think it's better to have it inlined
image

image

image

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Come on IntelliJ XD. Don't make good coding practices harder

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good c: Let's inline it before this issue is fixed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, a KDoc would also help, but it still doesn't show the value in the popup you show :/

Copy link
Contributor

Generated sources will be updated after merging this PR.
Please inspect the changes in here.

@Jolanrensen Jolanrensen merged commit ddfb7b9 into master Oct 16, 2024
4 of 5 checks passed
@Jolanrensen Jolanrensen deleted the flatten-separator branch October 16, 2024 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

flatten separator for keepParentNameForColumns should not be .
2 participants