Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle Unmergable errors when merging struct responses #152

Merged
merged 1 commit into from Oct 13, 2020

Conversation

larkee
Copy link
Contributor

@larkee larkee commented Oct 13, 2020

This PR fixes a bug in the StreamedResultSet logic for merging chunked values where the chunked value is an array of structs and the chunk boundary splits a struct element in two and the halves aren't correctly merged.

This bug results in the struct element incorrectly being split into two partial struct elements.

Expected:

('foo', 0.5, DatetimeWithNanoseconds(2020, 1, 1, 0, 0, tzinfo=<UTC>))

Actual:

('foo', 0.5)
('2020-01-01T00:00:00Z',)

This bug is caused by an unhandled Unmergable error in _merge_struct. This PR adds the same handling used for _merge_array and a unit test to prove the fix works.

@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Oct 13, 2020
@larkee larkee marked this pull request as ready for review October 13, 2020 03:02
@larkee larkee requested a review from a team as a code owner October 13, 2020 03:02
Copy link
Contributor

@thiagotnunes thiagotnunes left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants