FrameColumn.schema can produce types with redundant out variance
Open
Nobody has claimed this yet.
bug
- Dominant language
- Kotlin
- Stars
- 1.1k
- Forks
- 83
- Avg merge
- 4d 12h
- Merged PRs (30d)
- 30
Description
Consider FrameColumn where 1 dataframe is empty, and 1 has nullability
Common schema is computed by intersectSchema.
val l = listOf(listOf(3.0))
val col1 = DataColumn.createByType("col", l)
val col2 = col1.take(0)
@Suppress("KotlinConstantConditions")
val col3 = col1.map { it.takeIf { false } }
val df = dataFrameOf(
"frameCol" to columnOf(
dataFrameOf(col1), dataFrameOf(col2), dataFrameOf(col3)
)
)
df.schema().print()
It creates a type with out variance that's redundant here:
frameCol: *
col: List<out Double>?
df.generateDataClasses().print()
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reproducer in the issue and inspect intersectSchema, which computes the common schema for the empty and nullable DataFrame columns. Run the schema and generateDataClasses examples to confirm the redundant out variance, then trace the schema result to determine the expected type and verify that both outputs no longer contain the unnecessary variance.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100