Skip to content

Aligned column name clashing handling across different IO#1904

Open
AndreiKingsley wants to merge 8 commits into
masterfrom
column_name_generator_in_excel
Open

Aligned column name clashing handling across different IO#1904
AndreiKingsley wants to merge 8 commits into
masterfrom
column_name_generator_in_excel

Conversation

@AndreiKingsley

@AndreiKingsley AndreiKingsley commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Closes #387.

Now ColumnNameGenerator is used in all IO implementations, behavior is aligned.

Deprecated Excel approach. Added a snippet about behavior in IO KDocs.

Added kodex to IO modules.


/** [Auto-renaming columns in DataFrame][AutoRenamingColumnsInDataFrame] */
internal typealias AutoRenamingLink = Nothing
internal typealias AutoRenameInputSnippet = Nothing

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

is this one used?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Should be used in IO modules, after kodex fix

*
* ## Auto-renaming columns in [DataFrame]
*
* [DataFrame] can not contain columns with duplicate names.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

cannot

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

no clue why, English is weird

* using the pattern `"\$name\$n"`, where `name` is the original column name
* and `n` is a unique index (1, 2, 3, and so on);
* the first time the name of the column is encountered, no number is appended.
*

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

maybe it's clearer to move the sample here. For example: "name", "name1", "name2", etc. That may be clearer :)

import kotlin.annotation.AnnotationTarget.TYPEALIAS
import kotlin.annotation.AnnotationTarget.VALUE_PARAMETER

// TODO use KDoc-helpers from :core

@Jolanrensen Jolanrensen Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Try this in the build.gradle.kts. I remembered I built some system for adding contextual sources for KoDEx :P

kodexConvention {
    contextualSourcesDirectories =
        project(projects.core.path)
            .sourceSets
            .main.get()
            .allSource
}

tasks.processKDocsMain {
    dependsOn(project(projects.core.path).tasks.assemble)
}


private const val MESSAGE_REMOVE_1_1 = "Will be removed in 1.1."
internal const val READ_EXCEL_OLD = "This function is only here for binary compatibility. $MESSAGE_REMOVE_1_1"
internal const val NAME_REPAIR_STRATEGY: String =

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We don't have a system yet for tracking deprecations in other modules than core, but maybe we could mirror the same structure?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

How exactly?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

in util/deprecationMessages.kt I mean

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.

Use ColumnNameGenerator for consistent column name repair across IO readers

2 participants