Skip to content

Rename dfs function #333

Closed
Closed
@Jolanrensen

Description

@Jolanrensen

When I first read

df.select { dfsOf<Type> { it.size() > 10 } }

I thought it meant "Select dataframes of given type where their size is larger than 10".
Asking a friend of mine, they recognized "dfs" as "depth first search" but then they assumed it would return the deepest nested column, since a search is done when a result is found.

Plus, since this function traverses all column groups, it could just as well have been named bfs (breadth first search) and give the same result.

Clearly, this function needs renaming to avoid further confusion.

The functions that need to be renamed include dfs {}, dfsOf<> {} and allDfs(includeGroups: Boolean). Plus, in the internal parts of the library, the name DFS is also sometimes used to just mean a "recursive flattening" of columns, which is definitely not a "search".

Candidates for a rename include:

df.select { traversingGroups { it.size() > 10 } }
df.select { traversingGroupsColsOf<Type> { it.size() > 10 } } // ??
df.select { allTraversingGroups(includeGroups = false) } // ?

or

df.select { cols(traversingGroups = true) { it.size() > 10 } }
df.select { colsOf<Type>(traversingGroups = true) { it.size() > 10 } }
df.select { all(traversingGroups = false, includeGroups = true) } // ?

or

df.select { allLevels { it.size() > 10 } }
df.select { allLevelsOf<Type> { it.size() > 10 } } // ?
df.select { allLevels(includeGroups = false) } // ?

Other ideas are welcome :)

Metadata

Metadata

Assignees

Labels

invalidThis issue/PR doesn't seem right

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions