dataframe icon indicating copy to clipboard operation
dataframe copied to clipboard

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

Open zaleslaw opened this issue 2 years ago • 2 comments

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

zaleslaw avatar Dec 04 '23 14:12 zaleslaw

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

Jolanrensen avatar Dec 04 '23 14:12 Jolanrensen

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

zaleslaw avatar Dec 04 '23 14:12 zaleslaw

@AndreiKingsley I suggest to freshen up this task, to estimate how much changes should be done

zaleslaw avatar Nov 10 '25 14:11 zaleslaw