Skip to content

PoC: DF without SupportedDataFrameFormat#1858

Draft
Jolanrensen wants to merge 1 commit into
masterfrom
removing-dataframe-read
Draft

PoC: DF without SupportedDataFrameFormat#1858
Jolanrensen wants to merge 1 commit into
masterfrom
removing-dataframe-read

Conversation

@Jolanrensen
Copy link
Copy Markdown
Collaborator

@Jolanrensen Jolanrensen commented May 12, 2026

#450 @zaleslaw

Simple proof-of-concept to see what DF without DataFrame.read() and SupportedDataFrameFormat would look like. We don't really need it after removing the KSP/Gradle. The only thing we would lose is the DataFrame.read() function.

Creating the PR, I did see a lot of examples where this function was used, so maybe entirely removing it is not the best approach.
DataFrame.read() may still have a place in the library to read data instance. It's common practice in other DataFrame-like libraries in other ecosystems. But I do believe we should lean more into the dynamically typed approach if we do want to keep it. So, accepting Any, accepting custom properties, etc.

If we do remove it, we should probably also refactor SupportedCodeGenerationFormat, because it's tightly interwoven between OpenAPI() and importDataSchema() in notebooks.

@Test
fun `sort by nested column`() {
val df = testResource("ds_salaries.csv").readDataFrame().cast<DsSalaries>()
val df = DataFrame.readCsv(testResource("ds_salaries.csv")).cast<DsSalaries>()
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.

Looks more better:)

@Test
fun `Sorted grouped iris dataset`() {
val irisData = DataFrame.read("src/test/resources/irisDataset.csv")
val irisData = DataFrame.readCsv("src/test/resources/irisDataset.csv")
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.

readCsv is better to me rather than read(....csv)

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.

it is safer, for sure, but I do like the idea of just pointing dataframe to a file and letting it "figure it out"

import java.nio.file.Path

// TODO: https://github.com/Kotlin/dataframe/issues/450
public class Jdbc :
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.

Make no sense for JDBC, it's readFROMFILE

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.

2 participants