Skip to content
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

[Important Fix!] Parse started to removed unselected columns #947

Merged
merged 1 commit into from
Nov 8, 2024

Conversation

Jolanrensen
Copy link
Collaborator

Fixed parseImpl() removing unselected columns by reverting implementation to use convert instead of insert.

We didn't have a test that ran parse { someCol }, but I found it running the example in README.md

@Jolanrensen Jolanrensen added the bug Something isn't working label Nov 8, 2024
@Jolanrensen Jolanrensen added this to the 0.15.0 milestone Nov 8, 2024
@koperagen
Copy link
Collaborator

Why is it different from original code? isFrameColumn changed

internal fun <T> DataFrame<T>.parseImpl(options: ParserOptions?, columns: ColumnsSelector<T, Any?>) =
    convert(columns).to {
        when {
            it.isFrameColumn() -> it.cast<AnyFrame?>().parse(options)

            it.isColumnGroup() ->
                it.asColumnGroup()
                    .parse(options) { all() }
                    .asColumnGroup(it.name())
                    .asDataColumn()

            it.typeClass == String::class -> it.cast<String?>().tryParse(options)

            else -> it
        }
    }

@Jolanrensen
Copy link
Collaborator Author

@koperagen I changed it last time so all logic of parseImpl lives inside parseImpl, making it easier to debug, understand how it works, and parallelize in the future.

@Jolanrensen Jolanrensen merged commit 79bd076 into master Nov 8, 2024
4 checks passed
@Jolanrensen Jolanrensen deleted the parse-fix branch November 8, 2024 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants