[Internal] Binary Encoding: Fixes DateTime Parsing Issue#5133
Merged
FabianMeiswinkel merged 7 commits intomasterfrom Apr 17, 2025
Merged
Conversation
…in_binary_encoding
kundadebdatta
commented
Apr 15, 2025
…in_binary_encoding
…in_binary_encoding
…in_binary_encoding
…in_binary_encoding
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.
Pull Request Template
Description
During some of the internal binary encoding opt-in customer workload validation, it was identified that when the cosmos .net SDK is initialized with binary encoding, and a date time field is persisted into a database, the value is getting converted and stored as in non-ISO format.
Cosmos Client Creation:
Sample Data Saved in Container, when binary encoding is Disabled in the SDK:
Sample Data Saved in Container, when binary encoding is Enabled in the SDK:
This PR is fixing the above parsing gap. It appears that when a stream is sent to the backend in
Textformat, the backend does some formatting on the incoming stream, that convertsDateTimefields intoISO 8601format and stores it.Per my analysis, when binary encoding is enabled, and the stream sent to backend is in Binary format, the backend doesn't do any extra formatting on the binary stream, and stores the stream as is. Therefore, the round-trip ("O", "o") format specifier in the SDK layer is ideal to keep the
DateTimefield preserved in ISO standard, when binary encoding is enabled,Type of change
Please delete options that are not relevant.
Closing issues
To automatically close an issue: closes #5132