Repository navigation
fix: handle missing values in column profiling - #1150
Merged
andreatnvidia merged 3 commits intoNov 11, 2026
Merged
andreatnvidia merged 3 commits into
andreatnvidia merged 3 commits into
Conversation
Profiling failed or misreported in three cases where pandas leaves a statistic undefined or represents a missing value as pd.NA: - Output token statistics of an LLM column with a single record raised "float() argument must be ... not 'NAType'" on pandas 3.1+, because Series.apply keeps the Arrow backing and its sample stddev is pd.NA. Compute them on a float64 series. - A single-record numerical column dropped its whole distribution for the same reason. Report the undefined stddev as NaN and keep min, max, mean and median. - General column info counted a missing value as the distinct string "<NA>" (ensure_hashable), so num_null was 0 and num_unique one too high for nullable numeric, string and boolean columns. Count nulls on the original column and leave them out of the unique count. Fixes NVIDIA-NeMo#1144 Fixes NVIDIA-NeMo#1147 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: William Caban <william.caban@gmail.com>
Contributor
|
All contributors have signed the DCO ✍️ ✅ |
Contributor
Author
|
I have read the DCO document and I hereby sign the DCO. |
Contributor
[Medium impact] The PR appears safe to merge; no actionable bugs or repository-rule violations were found. SummaryFixes profiling for nullable columns and single-record datasets.
Reviews (3) · Last reviewed commit: "Merge branch 'main' into williamcaban/fi..." · Reviewed by Greptile |
Contributor
Author
|
recheck |
andreatnvidia
previously approved these changes
Nov 10, 2026
Create a one-record numerical dataset, check that the undefined standard deviation survives the saved metadata JSON, then resume the completed run and check the re-profiled distribution. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: William Caban <william.caban@gmail.com>
andreatnvidia
enabled auto-merge (squash)
November 11, 2026 10:57
andreatnvidia
approved these changes
Nov 11, 2026
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.
📋 Summary
Fixes three cases where profiling failed or misreported because a statistic is undefined or a missing value is
pd.NA: the output-token stddev of a single-record LLM column on pandas 3.1+, the distribution of a single-record numerical column, and the null and unique counts of nullable columns. Done as one profiling PR as discussed on #1144 and #1147.🔗 Related Issue
Fixes #1144
Fixes #1147
🔄 Changes
🐛 Fixed
calculate_output_token_statscomputes on afloat64series. On pandas 3.1+Series.applykeeps the Arrow backing of a structured LLM column and the sample stddev of one value ispd.NA, whichllm_column_ensure_python_floatscannot convert (DataDesignerProfilingError on pandas 3.1.x when previewing a single record with an LLM column #1144).NumericalDistribution.from_seriesreports an undefined stddev asNaNinstead of failing, so a single-record numerical column keeps its min, max, mean and median. This already failed on pandas 2.3.3 and 3.0.x.calculate_general_column_infocounts nulls on the original column and drops them before the unique count.ensure_hashableturnedpd.NAinto the string"<NA>", sonum_nullwas 0 andnum_uniqueone too high for nullable numeric, string and boolean columns (Profiling miscounts nulls and unique values in nullable columns on pandas 3.1 #1147).🧪 Testing
make testpassesmakeneeds uv 0.13.4 or newer, so I ran the same suites withpytestdirectly (config 834, engine 2981, interface 1337 passed). They pass on the locked pandas 3.0.5 and on 3.1.1, andruff formatandruff checkare clean on the changed files.New tests:
NumericalDistribution.from_seriesfor one value on NumPy, nullable and Arrow float series, and a multi-value Arrow series.previewandcreatefor nullable seeds and for a single-record sampler.On pandas 3.1.1 without the fix 13 tests fail, 11 of them new. The other two are existing tests (
test_calculate_general_column_infoand the profiler Jinja-engine test) thatmainalso fails on 3.1.1.I did not add a plan document because the change is small and limited to the statistics code. Happy to add one if you prefer.
✅ Checklist
triaged🤖 Generated with Claude Code