-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Compiler plugin] Use annotation to filter out scope properties from …
…schema classes
- Loading branch information
Showing
13 changed files
with
175 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import org.jetbrains.kotlinx.dataframe.annotations.* | ||
import org.jetbrains.kotlinx.dataframe.api.* | ||
import org.jetbrains.kotlinx.dataframe.io.* | ||
import org.jetbrains.kotlinx.dataframe.* | ||
|
||
fun box(): String { | ||
val sample = | ||
@Import DataFrame.readCSV("https://raw.githubusercontent.com/Kotlin/dataframe/master/data/jetbrains_repositories.csv") | ||
|
||
val organizations = listOf("https://raw.githubusercontent.com/Kotlin/dataframe/master/data/jetbrains_repositories.csv") | ||
organizations.forEach { organization -> | ||
val df = DataFrame.readCSV(organization).castTo(sample) | ||
println(organizations) | ||
println("Repositories: ${df.count()}") | ||
println("Top 10:") | ||
df.sortBy { stargazers_count.desc() }.take(10).print() | ||
} | ||
return "OK" | ||
} |
72 changes: 72 additions & 0 deletions
72
plugins/kotlin-dataframe/testData/box/propertiesOrder.fir.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
FILE: propertiesOrder.kt | ||
public final fun box(): R|kotlin/String| { | ||
lval df: R|org/jetbrains/kotlinx/dataframe/DataFrame<<local>/Read_16>| = Q|org/jetbrains/kotlinx/dataframe/DataFrame|.R|kotlin/let|<R|org/jetbrains/kotlinx/dataframe/DataFrame.Companion|, R|org/jetbrains/kotlinx/dataframe/DataFrame<<local>/Read_16>|>(<L> = fun <anonymous>(it: R|org/jetbrains/kotlinx/dataframe/DataFrame.Companion|): R|org/jetbrains/kotlinx/dataframe/DataFrame<<local>/Read_16>| <inline=Inline, kind=EXACTLY_ONCE> { | ||
local abstract class Read_16I : R|kotlin/Any| { | ||
@R|org/jetbrains/kotlinx/dataframe/annotations/Order|(order = Int(0)) public abstract val full_name: R|kotlin/String| | ||
public get(): R|kotlin/String| | ||
|
||
@R|org/jetbrains/kotlinx/dataframe/annotations/Order|(order = Int(3)) public abstract val topics: R|kotlin/String| | ||
public get(): R|kotlin/String| | ||
|
||
@R|org/jetbrains/kotlinx/dataframe/annotations/Order|(order = Int(4)) public abstract val watchers: R|kotlin/Int| | ||
public get(): R|kotlin/Int| | ||
|
||
@R|org/jetbrains/kotlinx/dataframe/annotations/Order|(order = Int(2)) public abstract val stargazers_count: R|kotlin/Int| | ||
public get(): R|kotlin/Int| | ||
|
||
@R|org/jetbrains/kotlinx/dataframe/annotations/Order|(order = Int(1)) public abstract val html_url: R|java/net/URL| | ||
public get(): R|java/net/URL| | ||
|
||
public constructor(): R|<local>/Read_16I| | ||
|
||
} | ||
|
||
local final class Scope0 : R|kotlin/Any| { | ||
public final val R|org/jetbrains/kotlinx/dataframe/DataRow<<local>/Read_16I>|.full_name: R|kotlin/String| | ||
public get(): R|kotlin/String| | ||
|
||
public final val R|org/jetbrains/kotlinx/dataframe/ColumnsContainer<<local>/Read_16I>|.full_name: R|org/jetbrains/kotlinx/dataframe/DataColumn<kotlin/String>| | ||
public get(): R|org/jetbrains/kotlinx/dataframe/DataColumn<kotlin/String>| | ||
|
||
public final val R|org/jetbrains/kotlinx/dataframe/DataRow<<local>/Read_16I>|.topics: R|kotlin/String| | ||
public get(): R|kotlin/String| | ||
|
||
public final val R|org/jetbrains/kotlinx/dataframe/ColumnsContainer<<local>/Read_16I>|.topics: R|org/jetbrains/kotlinx/dataframe/DataColumn<kotlin/String>| | ||
public get(): R|org/jetbrains/kotlinx/dataframe/DataColumn<kotlin/String>| | ||
|
||
public final val R|org/jetbrains/kotlinx/dataframe/DataRow<<local>/Read_16I>|.watchers: R|kotlin/Int| | ||
public get(): R|kotlin/Int| | ||
|
||
public final val R|org/jetbrains/kotlinx/dataframe/ColumnsContainer<<local>/Read_16I>|.watchers: R|org/jetbrains/kotlinx/dataframe/DataColumn<kotlin/Int>| | ||
public get(): R|org/jetbrains/kotlinx/dataframe/DataColumn<kotlin/Int>| | ||
|
||
public final val R|org/jetbrains/kotlinx/dataframe/DataRow<<local>/Read_16I>|.stargazers_count: R|kotlin/Int| | ||
public get(): R|kotlin/Int| | ||
|
||
public final val R|org/jetbrains/kotlinx/dataframe/ColumnsContainer<<local>/Read_16I>|.stargazers_count: R|org/jetbrains/kotlinx/dataframe/DataColumn<kotlin/Int>| | ||
public get(): R|org/jetbrains/kotlinx/dataframe/DataColumn<kotlin/Int>| | ||
|
||
public final val R|org/jetbrains/kotlinx/dataframe/DataRow<<local>/Read_16I>|.html_url: R|java/net/URL| | ||
public get(): R|java/net/URL| | ||
|
||
public final val R|org/jetbrains/kotlinx/dataframe/ColumnsContainer<<local>/Read_16I>|.html_url: R|org/jetbrains/kotlinx/dataframe/DataColumn<java/net/URL>| | ||
public get(): R|org/jetbrains/kotlinx/dataframe/DataColumn<java/net/URL>| | ||
|
||
public constructor(): R|<local>/Scope0| | ||
|
||
} | ||
|
||
local abstract class Read_16 : R|<local>/Read_16I| { | ||
@R|org/jetbrains/kotlinx/dataframe/annotations/ScopeProperty|() public abstract val scope0: R|<local>/Scope0| | ||
public get(): R|<local>/Scope0| | ||
|
||
public constructor(): R|<local>/Read_16| | ||
|
||
} | ||
|
||
^ @R|org/jetbrains/kotlinx/dataframe/annotations/Import|() R|<local>/it|.R|org/jetbrains/kotlinx/dataframe/io/read|(String(https://raw.githubusercontent.com/Kotlin/dataframe/master/data/jetbrains_repositories.csv)) | ||
} | ||
) | ||
(this@R|/box|, R|<local>/df|).R|<local>/Scope0.full_name| | ||
^box String(OK) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// FIR_DUMP | ||
|
||
import org.jetbrains.kotlinx.dataframe.* | ||
import org.jetbrains.kotlinx.dataframe.io.read | ||
import org.jetbrains.kotlinx.dataframe.api.* | ||
import org.jetbrains.kotlinx.dataframe.annotations.* | ||
|
||
fun box(): String { | ||
val df = @Import DataFrame.read("https://raw.githubusercontent.com/Kotlin/dataframe/master/data/jetbrains_repositories.csv") | ||
df.full_name | ||
return "OK" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters