Skip to content

Commit d9d03cc

Browse files
committed
Fix compilation
1 parent e340fe2 commit d9d03cc

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/parse.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ internal object Parsers : GlobalParserOptions {
121121
}
122122

123123
private fun String.toUrlOrNull(): URL? {
124-
return if (isURL()) catchSilent { URL(this) } else null
124+
return if (isURL(this)) catchSilent { URL(this) } else null
125125
}
126126

127127
private fun String.toBooleanOrNull() =

src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/arrow.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,14 @@ public fun DataFrame.Companion.readArrow(stream: InputStream): AnyFrame = Channe
179179

180180
public fun DataFrame.Companion.readArrow(url: URL): AnyFrame =
181181
when {
182-
url.isFile() -> readArrow(url.asFile())
183-
url.isProtocolSupported() -> url.openStream().use { readArrow(it) }
182+
isFile(url) -> readArrow(urlAsFile(url))
183+
isProtocolSupported(url) -> url.openStream().use { readArrow(it) }
184184
else -> {
185185
throw IllegalArgumentException("Invalid protocol for url $url")
186186
}
187187
}
188188

189-
public fun DataFrame.Companion.readArrow(path: String): AnyFrame = if (path.isURL()) {
189+
public fun DataFrame.Companion.readArrow(path: String): AnyFrame = if (isURL(path)) {
190190
readArrow(URL(path))
191191
} else {
192192
readArrow(File(path))

src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/csv.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,15 +162,15 @@ private fun getCSVType(path: String): CSVType =
162162
}
163163

164164
private fun asStream(fileOrUrl: String) = (
165-
if (fileOrUrl.isURL()) {
165+
if (isURL(fileOrUrl)) {
166166
URL(fileOrUrl).toURI()
167167
} else {
168168
File(fileOrUrl).toURI()
169169
}
170170
).toURL().openStream()
171171

172172
internal fun asURL(fileOrUrl: String): URL = (
173-
if (fileOrUrl.isURL()) {
173+
if (isURL(fileOrUrl)) {
174174
URL(fileOrUrl).toURI()
175175
} else {
176176
File(fileOrUrl).toURI()

src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/guess.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ public fun DataFrame.Companion.read(file: File, header: List<String> = emptyList
124124
public fun DataRow.Companion.read(file: File, header: List<String> = emptyList()): AnyRow = DataFrame.read(file, header).single()
125125

126126
public fun DataFrame.Companion.read(url: URL, header: List<String> = emptyList()): AnyFrame = when {
127-
url.isFile() -> read(url.asFile(), header)
128-
url.isProtocolSupported() -> catchHttpResponse(url) { read(it, guessFormat(url), header) }
127+
isFile(url) -> read(urlAsFile(url), header)
128+
isProtocolSupported(url) -> catchHttpResponse(url) { read(it, guessFormat(url), header) }
129129
else -> throw IllegalArgumentException("Invalid protocol for url $url")
130130
}
131131

0 commit comments

Comments
 (0)