-
Notifications
You must be signed in to change notification settings - Fork 63
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
renameToCamelCase
for columns with names starting with capital letter should lowercase it
#302
Comments
renameToCamelCase
for columns with names starting with capital letter should lowercase it
@belovrv what kind of CamelCase do you want?
Why am I asking? Because for now, looks like the function doing what you want, it makes from column name "another_name" -> "anotherName" Or do you want to get in this case "AnotherName" ? But it's uppercase CamelCase For now, we have no documentation for this function, please give some examples of usage or share some insights |
@Jolanrensen how do you estimate this code? For me, it looks like a strange 2-3 level repeating function s with recursive call. If it's a common pattern to apply changes in the dataframe, could you advise how to interpret correctly the code?
|
@zaleslaw It might look clearer after my rename: public fun <T> DataFrame<T>.renameToCamelCase(): DataFrame<T> = this
.rename {
// rename groups first, because groups and their children cannot be renamed/moved at the same time
groups { it.name() matches DELIMITED_STRING_REGEX }.recursively()
}.toCamelCase()
.rename {
cols { it.name() matches DELIMITED_STRING_REGEX }.recursively(includeGroups = false)
}.toCamelCase()
.update {
colsOf<AnyFrame>().recursively()
}.with { it.renameToCamelCase() } |
Now if you have |
No description provided.
The text was updated successfully, but these errors were encountered: