🐛 Fix dtype degradation of partial-null bool/int features#3752
Open
ishitajain9717 wants to merge 4 commits into
Open
🐛 Fix dtype degradation of partial-null bool/int features#3752ishitajain9717 wants to merge 4 commits into
ishitajain9717 wants to merge 4 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3752 +/- ##
==========================================
- Coverage 91.55% 86.50% -5.06%
==========================================
Files 88 88
Lines 15137 15336 +199
==========================================
- Hits 13859 13266 -593
- Misses 1278 2070 +792
🚀 New features to boost your workflow:
|
|
Deployment URL: https://a411eaaf.lamindb.pages.dev |
falexwolf
reviewed
Jun 22, 2026
| } | ||
| ) | ||
| with pytest.raises(ln.errors.ValidationError): | ||
| ln.curators.DataFrameCurator(df_degraded, schema).validate() |
Member
There was a problem hiding this comment.
Can you please add a test that makes evident which error message is raised here?
falexwolf
reviewed
Jun 22, 2026
| # produces after the cast. We are asserting the curator accepts these dtypes. | ||
| df_good = pd.DataFrame( | ||
| { | ||
| "cur-flag": pd.array([True, None, False], dtype="boolean"), |
object type column
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a ValidationError in
Record.from_dataframe(...).save()when abool/intfeature hasNoneon some rows but not others. Internally the save path rebuilt the frame with pd.DataFrame(prepared_rows), which let pandas re-infer and degrade those columns(bool → object, int → float64), failing thedtypecheck even for correctly-typed nullable input.The frame is now built column-by-column using each feature's declared
dtype(convert_to_pandas_dtype), so dtypes never degrade. Adds tests covering both the DataFrameCurator (accepts nullable boolean/Int64, rejects degraded object/float64) and thefrom_dataframesave round-trip.Fixing : pfizer-collab/laminlabs#1009