Skip to content

Make AnyFrame.cast verify schemas by default - #2006

Draft
zaleslaw with Copilot wants to merge 2 commits into
masterfrom
copilot/improve-schema-checking-cast
Draft

Make AnyFrame.cast verify schemas by default#2006
zaleslaw with Copilot wants to merge 2 commits into
masterfrom
copilot/improve-schema-checking-cast

Conversation

Copilot AI commented Jul 28, 2026

Copy link
Copy Markdown

The no-argument cast() overload currently bypasses schema verification, allowing mismatches to fail later during column access. Make checked casting the default while retaining an explicit escape hatch for trusted unchecked casts.

  • Casting API

    • cast<T>() now uses schema verification by default.
    • Added castUnsafe<T>() for unchecked DataFrame and DataRow casts.
    • Preserved verify = false and existing JVM signatures.
  • Internal usage

    • Updated generic/internal casts to call castUnsafe() explicitly.
    • Regenerated processed core sources and updated cast documentation.
  • Regression coverage

    • Default casts now assert on schema mismatches.
    • Unchecked casts and verify = false remain supported.
val raw = dataFrameOf("name" to columnOf("Ada"))

raw.cast<Person>()                 // Fails fast if Person's schema differs
raw.cast<Person>(verify = false)   // Skips verification
raw.castUnsafe<Person>()           // Explicit unchecked cast

Copilot AI changed the title [WIP] Update AnyFrame.cast to check schema by default Make AnyFrame.cast verify schemas by default Jul 28, 2026
Copilot AI requested a review from zaleslaw July 28, 2026 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make AnyFrame.cast actually check schema by default

2 participants