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

feat(bigquery/storage/managedwriter): refactor AppendResponse #6402

Merged
merged 9 commits into from
Jul 29, 2022

Conversation

shollyman
Copy link
Contributor

@shollyman shollyman commented Jul 22, 2022

The potential fields exposed within an AppendResponse has grown as
the API has evolved. This PR refactors AppendResult to use a
retained reference of the response for servicing requests.

This allows the logic for processing the response to be centralized
a bit more within the AppendResult. We also introduce a new
FullResponse() on the AppendResult which returns the full
AppendRowsResponse if present.

The potential fields exposed within an AppendResponse has grown as
the API has evolved.  This PR refactors AppendResult to use a
retained reference of the response for servicing requests.

This allows the logic for processing the response to be centralized
a bit more within the AppendResult.  We also introduce a new
RawResponse() on the AppendResult which returns the full
AppendRowsResponse if present.
@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: bigquery Issues related to the BigQuery API. labels Jul 22, 2022
@product-auto-label product-auto-label bot added size: l Pull request size is large. and removed size: m Pull request size is medium. labels Jul 22, 2022
@shollyman shollyman marked this pull request as ready for review July 27, 2022 17:16
@shollyman shollyman requested a review from a team July 27, 2022 17:16
@shollyman shollyman requested a review from a team as a code owner July 27, 2022 17:16
@shollyman shollyman requested review from Neenu1995 and yirutang and removed request for Neenu1995 July 27, 2022 17:16
Copy link
Contributor

@yirutang yirutang left a comment

Choose a reason for hiding this comment

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

I am not sure, is this changing the public interface?

@shollyman
Copy link
Contributor Author

I am not sure, is this changing the public interface?

Existing users can continue to use GetResult() on the returned future which returns the same (offset, error) tuple without change. The difference is that the future now exposes the GetRawResult() as an alternative, which returns the full AppendRowsResponse. I'm still not enamored of the method name, perhaps FullResponse() is a better choice?

@yirutang
Copy link
Contributor

yirutang commented Jul 28, 2022 via email

@shollyman
Copy link
Contributor Author

What are the other things you want to expose through FullResponse()? (I like that name better)

The error row information, and any new fields we have from future features (multiplexing, cdc, etc).

I can also leave the full response off for now, and proceed with the rest of the refactor.

Copy link
Contributor

@yirutang yirutang left a comment

Choose a reason for hiding this comment

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

I see. Make sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the BigQuery API. size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants