Skip to content

Support special IEEE754 values serdes in tables + fix some serdes issues with non-string dictionaries #92

Open
toptobes wants to merge 8 commits intomainfrom
KG-special-ieee754-values
Open

Support special IEEE754 values serdes in tables + fix some serdes issues with non-string dictionaries #92
toptobes wants to merge 8 commits intomainfrom
KG-special-ieee754-values

Conversation

@toptobes
Copy link
Collaborator

@toptobes toptobes commented Mar 14, 2026

IMPORTANT: This PR swallowed #95

Resolves #65 and fixes #96

I would like to use an IFloatingPointIeee754-based solution to deduplicate [Float|Double]Converter but I think I need to use C#11+ to do that...

@toptobes toptobes requested a review from sl-at-ibm March 14, 2026 06:04
@toptobes toptobes force-pushed the KG-special-ieee754-values branch from ca859e3 to 3516365 Compare March 14, 2026 06:07
_ => throw new JsonException($"Unexpected string value '{reader.GetString()}' for double type") // should never actually happen
};
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: 8 whitespaces to remove

{
return reader.GetDouble();
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: 8 whitespaces

_ => throw new JsonException($"Unexpected string value '{reader.GetString()}' for float type") // should never actually happen
};
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: 8 whitespaces

{
return reader.GetSingle();
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: 8 whitespaces

Copy link
Collaborator

@sl-at-ibm sl-at-ibm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@toptobes toptobes force-pushed the KG-special-ieee754-values branch from 3516365 to a3f1b45 Compare March 17, 2026 23:11
sl-at-ibm and others added 3 commits March 17, 2026 18:18
# Conflicts:
#	test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/AdditionalTableTests.cs
@toptobes toptobes force-pushed the KG-special-ieee754-values branch from a3f1b45 to 33fb557 Compare March 17, 2026 23:21
@toptobes toptobes changed the title Support Nan, Infinity and -Infinity when reading/writing floats/doubles Support special IEEE754 values serdes in tables + fix some serdes issues with non-string dictionaries Mar 17, 2026
@toptobes toptobes force-pushed the KG-special-ieee754-values branch 2 times, most recently from d5bbc92 to e1a6a6a Compare March 18, 2026 01:59
@toptobes toptobes force-pushed the KG-special-ieee754-values branch from e1a6a6a to a05be67 Compare March 18, 2026 02:23
@toptobes toptobes requested a review from sl-at-ibm March 18, 2026 05:31
@toptobes toptobes force-pushed the KG-special-ieee754-values branch from bdec3b0 to ed7c3bb Compare March 18, 2026 05:31
{
return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(Dictionary<,>);
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: spurious whitespaces on lines: 31 41 46 49 54 79.

}

[Fact]
public async Task SteoNonstringMapTableInsertionTests()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I'd like my name to remain in the csharp client history, I'm also humble enough to suggest the name of this test (and the associated table) be edited to a more serious choice :p

Copy link
Collaborator

@sl-at-ibm sl-at-ibm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Minor remarks if you can spare a few minutes

  1. whitespaces
  2. rename "steo" tests (lol)
  3. the "XML comments" warnings seem all fine to me. There must be a way to silence them (but without missing the important stuff)...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Serialization of non-string-keyed dictionaries for untyped tables fails Nan, Infinity and -Infinity not recognized when reading floats/doubles

2 participants