GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — NaN in FLOAT/DOUBLE columns is returned as None (same as NULL) when pandas is enabled (#978) by peco-engineer-bot[bot] · Pull Request #1005 · databricks/databricks-sql-python Conversation
Contributor
SummaryAutomated fix for #978 — NaN in FLOAT/DOUBLE columns is returned as None (same as NULL) when pandas is enabled. With pandas enabled, a NaN in a FLOAT or DOUBLE column now comes back as Root cause & planRoot cause: ResultSet._convert_arrow_table (src/databricks/sql/result_set.py, ~L109-133) maps pyarrow float32/float64 to pandas' nullable Float32Dtype/Float64Dtype in the to_pandas types_mapper. That conversion treats IEEE NaN as missing (pd.NA), and df.to_numpy(na_value=None, dtype="object") then turns it into None. The result is that NaN can't be told apart from SQL NULL. The _disable_pandas=True path uses as_py() and correctly returns float('nan'). All three backends (Thrift, SEA, kernel) call this shared method from fetchone/fetchmany/fetchall, so all of them are affected.
Files changed
Test plan
🤖 Generated by engineer-bot (bug-fix flow) — review before merge.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions…andas is enabled (#978) Signed-off-by: peco-engineer-bot[bot] <3815206+peco-engineer-bot[bot]@users.noreply.github.com> There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Verdict: 1 Low Looks good: the fix restores NaN from the Arrow column after the pandas conversion, so NaN and NULL are now distinct. It covers chunked arrays and duplicate column names and is tested at both the unit and E2E levels. One low-severity suggestion: the per-cell restore loop could be a single vectorized assignment.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsUh oh!
There was an error while loading. Please reload this page. Addresses: - #4418224915 at src/databricks/sql/result_set.py:147 Signed-off-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com> There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Verdict: 1 Low Looks good. The fix is correct and well-scoped, with one low-severity performance note. The Arrow-side
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsUh oh!
There was an error while loading. Please reload this page. Addresses: - #4418281963 at src/databricks/sql/result_set.py:143 Signed-off-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com> There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ No issues identified by the review bot.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsThis branch was previously deployed1 inactive deployment
azure-prod
—
82f1c385
Deployed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
engineer-bot
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. 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. |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |