Skip to content

Commit 340c11b

Browse files
authored
Merge pull request #357 from Kantis/fix-path-with-spaces
Avoiding to use the URL-encoded path
2 parents ae2ee7a + fc63076 commit 340c11b

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed

core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/common.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ public fun isFile(url: URL): Boolean = url.protocol == "file"
5555

5656
public fun asFileOrNull(url: URL): File? = if (isFile(url)) File(url.path) else null
5757

58-
public fun urlAsFile(url: URL): File = File(url.path)
58+
public fun urlAsFile(url: URL): File = File(url.toURI())
5959

6060
public fun isProtocolSupported(url: URL): Boolean = url.protocol in setOf("http", "https", "ftp")

core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/common.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ public fun isFile(url: URL): Boolean = url.protocol == "file"
5555

5656
public fun asFileOrNull(url: URL): File? = if (isFile(url)) File(url.path) else null
5757

58-
public fun urlAsFile(url: URL): File = File(url.path)
58+
public fun urlAsFile(url: URL): File = File(url.toURI())
5959

6060
public fun isProtocolSupported(url: URL): Boolean = url.protocol in setOf("http", "https", "ftp")
File renamed without changes.

plugins/dataframe-gradle-plugin/src/test/kotlin/org/jetbrains/dataframe/gradle/DataFrameReadTest.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package org.jetbrains.dataframe.gradle
22

33
import com.beust.klaxon.KlaxonException
44
import io.kotest.assertions.asClue
5+
import io.kotest.assertions.throwables.shouldNotThrowAny
56
import io.kotest.assertions.throwables.shouldThrow
67
import io.kotest.assertions.throwables.shouldThrowAny
78
import io.kotest.matchers.shouldBe
@@ -13,6 +14,8 @@ import java.io.FileNotFoundException
1314
import java.io.IOException
1415
import java.net.URL
1516
import java.nio.file.Files
17+
import java.nio.file.Paths
18+
import kotlin.io.path.absolutePathString
1619

1720
class DataFrameReadTest {
1821

@@ -75,10 +78,12 @@ class DataFrameReadTest {
7578
}
7679
}
7780
}
78-
81+
7982
@Test
8083
fun `data accessible and readable`() {
81-
val df = DataFrame.read(File("../../data/jetbrains_repositories.csv"))
84+
shouldNotThrowAny {
85+
DataFrame.read(Paths.get("../../data/jetbrains repositories.csv").absolutePathString())
86+
}
8287
}
8388

8489
@Test

plugins/symbol-processor/src/test/kotlin/org/jetbrains/dataframe/ksp/DataFrameSymbolProcessorTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,7 @@ class DataFrameSymbolProcessorTest {
10421042
result.successfulCompilation shouldBe false
10431043
}
10441044

1045-
private val jetbrainsCsv = File("../../data/jetbrains_repositories.csv")
1045+
private val jetbrainsCsv = File("../../data/jetbrains repositories.csv")
10461046

10471047
@Test
10481048
fun `imported schema resolved`() {

0 commit comments

Comments
 (0)