Repository navigation
Fixed incorrect columns in valueCounts of 0 rows - #2168
Conversation
|
@Kanish2002 thanks for the bugfix! I'll take it from here :) |
valueCounts of 0 rows
|
Made some tiny fixes, but we need to merge the fix for #2034 first so the tests pass as expected :) |
There was a problem hiding this comment.
Nice, targeted fix — just two test expectations to sort out before this can go green. 🙂
Produced by Air Automations. Name: AI Review / Run: https://air.jetbrains.cloud/org/05cf1a7f-6ab5-713b-abd3-29d0c8a05e2d/automations/8daf2412-0b6c-4433-90c0-b40ab5aebcdb?run=07e7bda9-a504-4728-a72f-b4f3d3205e0b
There was a problem hiding this comment.
Thanks for digging into this one — the structure-preserving slice is the right call; just one blocking note inline before merge.
Produced by Air Automations. Name: AI Review / Run: https://air.jetbrains.cloud/org/05cf1a7f-6ab5-713b-abd3-29d0c8a05e2d/automations/8daf2412-0b6c-4433-90c0-b40ab5aebcdb?run=6738ebad-f9e5-4432-be63-d5347fbb1134
4397774 to
f1eaac1
Compare
… The new behavior is expected, no need to mention it
f1eaac1 to
efef26e
Compare
|
@Kanish2002 thanks, I'll run the CI |
When no observations remain,
valueCountsrebuilds its observed-value column from an empty list. For a ColumnGroup, this loses the child columns. DataFrame counting uses a temporary group, sodf.take(0).valueCounts("city")can return[rows, count]rather than[city, count].Use an empty slice for structured columns when there are no distinct values. Value columns keep the existing type-aware construction, preserving their runtime nullability according to
dropNA. Nonempty counting and public signatures are unchanged.Regression coverage includes empty all-column/selected-column frames, all rows excluded by
dropNAusing a genuinely nullable String fixture, an empty ColumnGroup with non-nullable children, and empty nullable value columns withdropNAboth enabled and disabled. The website description documents the empty result.Fixes #2167.
Validation:
annotations/Plugin.kt, and unchanged currentimpl/columns/ValueColumnImpl.ktwith Kotlin 2.4.21, targeting JVM 8, against published dataframe-core 1.0.0-rc01. Including the current implementation exercises its current slicing/nullability behavior rather than the older published implementation. Tests target JVM 11; friend paths expose library internals.git diff --checkpass.Found while preparing #2165, but independent of that API proposal. AI-assisted.