Skip to content
This repository was archived by the owner on Mar 31, 2026. It is now read-only.

fix: handle Unmergable errors when merging struct responses#152

Merged
larkee merged 1 commit intogoogleapis:masterfrom
larkee:fix-merge-bug
Oct 13, 2020
Merged

fix: handle Unmergable errors when merging struct responses#152
larkee merged 1 commit intogoogleapis:masterfrom
larkee:fix-merge-bug

Conversation

@larkee
Copy link
Copy Markdown
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 October 13, 2020 03:02
Copy link
Copy Markdown
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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants