fix: map NaN/Infinity float columns to JSON null instead of failing the workflow#144
Draft
Copilot wants to merge 4 commits into
Draft
fix: map NaN/Infinity float columns to JSON null instead of failing the workflow#144Copilot wants to merge 4 commits into
Copilot wants to merge 4 commits into
Conversation
When serde_json::Number::from_f64() returns None (for NaN / ±Infinity), return serde_json::Value::Null so the column is present in the result JSON with a null value rather than causing the workflow to fail. - FLOAT4 and FLOAT8 branches now return Ok(Null) for non-finite values - Update module-level type table: float4/float8 NaN/Inf → null - Update decode_column docstring accordingly - Update E2E test 11 in 21_typed_results.sql to assert completed status and verify nan_col/inf_col are JSON null while finite columns remain numbers Agent-Logs-Url: https://github.com/microsoft/pg_durable/sessions/d5483b1c-7ab7-41b4-83b5-736e9972e137 Co-authored-by: pinodeca <32303022+pinodeca@users.noreply.github.com>
…Inf guard After the is_nan()/is_infinite() guard, from_f64() is guaranteed to succeed for finite values. Replace the if-let/else-err pattern with .expect() to eliminate the dead error path identified by code review. Agent-Logs-Url: https://github.com/microsoft/pg_durable/sessions/d5483b1c-7ab7-41b4-83b5-736e9972e137 Co-authored-by: pinodeca <32303022+pinodeca@users.noreply.github.com>
…ggability Agent-Logs-Url: https://github.com/microsoft/pg_durable/sessions/d5483b1c-7ab7-41b4-83b5-736e9972e137 Co-authored-by: pinodeca <32303022+pinodeca@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix bug causing NaN and Infinity float values to drop columns
fix: map NaN/Infinity float columns to JSON null instead of failing the workflow
May 5, 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.
float4/float8columns containingNaNor±Infinitycaused the entire workflow to fail, sinceserde_json::Number::from_f64returnsNonefor non-finite values. This meant$result.nan_col-style substitutions were broken — either the column was missing or the instance was infailedstate.Changes
src/activities/execute_sql.rs—FLOAT4/FLOAT8decode branches now returnOk(serde_json::Value::Null)for non-finite values. After the finiteness guard,from_f64is guaranteed to succeed, so the dead error path is replaced with.unwrap_or_else(|| panic!(...))(value included in message). Updated module-level type table anddecode_columndocstring accordingly.tests/e2e/sql/21_typed_results.sql— Test 11 rewritten: queriesNaN,Infinity, and a finite column together; asserts the instance completes, thatnan_col/inf_colappear as JSONnull(key present), and that the finite column remains a JSON number.