[go: nahoru, domu]

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

Disable pretty printing in BigQuery unless explicitly requested #5337

Merged
merged 1 commit into from
Sep 22, 2020

Conversation

jskeet
Copy link
Collaborator
@jskeet jskeet commented Sep 22, 2020

This is client-wide, and can only be set on the BigQueryClientBuilder (to avoid an explosion of BigQueryClientImpl constructors in the long run). It is then propagated to all requests. It defaults to false.

In order to test this change properly, I've had to also add a Service property to BigQueryClientBuilder, but that seems appropriate anyway.

Fixes #5330.

@jskeet jskeet requested a review from a team as a code owner September 22, 2020 13:02
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Sep 22, 2020
Copy link
Contributor
@amanda-tarafa amanda-tarafa left a comment

Choose a reason for hiding this comment

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

LGTM. Just one comment.

@@ -66,6 +88,7 @@ public override async Task<BigQueryClient> BuildAsync(CancellationToken cancella
protected override void Validate()
{
base.Validate();
// TODO: Validate that if Service is set, no credentials are set?
Copy link
Contributor

Choose a reason for hiding this comment

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

That would be inline with what we do with the invokers in the gRPC equivalents. Can't Service here just be internal? We can always make it public later on if there's a need for it apart from testing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We could definitely make it internal, yes - I just don't like the idea that we can test stuff but others can't. Still, it means we don't need to worry about the TODO for now. Will remove this TODO, but add a note on the newly-internal property.

This is client-wide, and can only be set on the BigQueryClientBuilder (to avoid an explosion of BigQueryClientImpl constructors in the long run). It is then propagated to all requests. It defaults to false.

In order to test this change properly, I've had to also add a Service property to BigQueryClientBuilder, but that seems appropriate anyway.

Fixes googleapis#5330.
@jskeet jskeet merged commit 14be654 into googleapis:master Sep 22, 2020
@jskeet jskeet deleted the bq-pretty-print branch September 22, 2020 16:11
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.

BigQuery: audit use of dense JSON encoding
2 participants