Kotlin / dataframe

Structured data processing in Kotlin
https://kotlin.github.io/dataframe/overview.html
Apache License 2.0
784 stars 50 forks source link

Replace io.File on nio.Path in DataFrame.read methods #527

Open zaleslaw opened 7 months ago

zaleslaw commented 7 months ago

Now we are using File class from java.io in our API for reading DataFrames instead of Path from java.nio

For example

public interface SupportedDataFrameFormat : SupportedFormat {
    public fun readDataFrame(stream: InputStream, header: List<String> = emptyList()): DataFrame<*>

    public fun readDataFrame(file: File, header: List<String> = emptyList()): DataFrame<*>
}

Both of the classes are adopted in Kotlin with some of the extension functions, but usage of Path is more modern and highly-recommended for library creators.

I suggest replacing Path to File or temporarily add new method with Path for 1-2 releases to be aligned with modern recommendation

I want to add two additional links https://discuss.kotlinlang.org/t/file-vs-path-in-kotlin/26349 https://www.baeldung.com/java-path-vs-file

Jolanrensen commented 7 months ago

kotlin.io.path.Path exists in the Stdlib indeed, so it's probably as much supported as File. No objections from me

zaleslaw commented 7 months ago

@holgerbrandl we created an issue, let's count it on a roadmap! :)