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

docs(samples): add run details #334

Merged
merged 3 commits into from Sep 17, 2020
Merged

Conversation

pmakani
Copy link
Contributor

@pmakani pmakani commented Sep 9, 2020

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

@pmakani pmakani requested review from stephaniewang526 and Sep 9, 2020
@google-cla google-cla bot added the cla: yes label Sep 9, 2020
@pmakani pmakani added the kokoro:force-run label Sep 9, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run label Sep 9, 2020
String runId = "MY_RUN_ID";
// `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or
// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
Copy link
Member

@stephaniewang526 stephaniewang526 Sep 9, 2020

Choose a reason for hiding this comment

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

Suggested change
String runId = "MY_RUN_ID";
// `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or
// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
// runId examples:
// `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or
// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
String runId = "MY_RUN_ID";

lesv
lesv approved these changes Sep 9, 2020
Copy link

@lesv lesv left a comment

Consider the comments.

} catch (ApiException ex) {
System.out.print("Run details not found." + ex.toString());
}
Copy link

@lesv lesv Sep 9, 2020

Choose a reason for hiding this comment

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

Ok, but we prefer (Sample Format guide) that exceptions not be caught if you aren't going to actually do something with them.

"SELECT CURRENT_TIMESTAMP() as current_time, @run_time as intended_run_time, "
+ "@run_date as intended_run_date, 17 as some_integer";
String destinationTableName =
"MY_DESTINATION_TABLE_" + UUID.randomUUID().toString().substring(0, 8) + "_{run_date}";
Copy link

@lesv lesv Sep 9, 2020

Choose a reason for hiding this comment

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

This is probably ok, but some of those bits are actually constants. https://tools.ietf.org/html/rfc4122

.setTransferConfig(transferConfig)
.build();
name = dataTransferServiceClient.createTransferConfig(request).getName();
System.out.println("\nScheduled query created successfully :" + name);
Copy link

@lesv lesv Sep 9, 2020

Choose a reason for hiding this comment

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

Hard coding the \n will be caught by various static analyzers.

@product-auto-label product-auto-label bot added the api: bigquerydatatransfer label Sep 10, 2020
@pmakani pmakani added the kokoro:force-run label Sep 11, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run label Sep 11, 2020
@stephaniewang526
Copy link
Member

@stephaniewang526 stephaniewang526 commented Sep 11, 2020

Reaching out to DTS TL about quota issue:

com.google.api.gax.rpc.ResourceExhaustedException: io.grpc.StatusRuntimeException: RESOURCE_EXHAUSTED: Quota exceeded for quota group 'DataTransferServiceOthersGroup' and limit 'ProjectQps' of service 'bigquerydatatransfer.googleapis.com' for consumer 'project_number:779844219229'.

will be in touch about this one.

@stephaniewang526 stephaniewang526 added the do not merge label Sep 11, 2020
@product-auto-label product-auto-label bot added the samples label Sep 12, 2020
@stephaniewang526
Copy link
Member

@stephaniewang526 stephaniewang526 commented Sep 14, 2020

To address the quota issue, for all the DTS samples that involve dataset and scheduled query, let's use our newly created env vars:

BIGQUERYDATATRANSFER_DATASET_NAME
DTS_TRANSFER_CONFIG_NAME

@stephaniewang526 stephaniewang526 removed the do not merge label Sep 17, 2020
@codecov
Copy link

@codecov codecov bot commented Sep 17, 2020

Codecov Report

Merging #334 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #334   +/-   ##
=========================================
  Coverage     74.68%   74.68%           
  Complexity      108      108           
=========================================
  Files             7        7           
  Lines           948      948           
  Branches         18       18           
=========================================
  Hits            708      708           
  Misses          220      220           
  Partials         20       20           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5a09efb...7449dde. Read the comment docs.

@stephaniewang526 stephaniewang526 merged commit 8824cc5 into googleapis:master Sep 17, 2020
17 checks passed
@pmakani pmakani deleted the run-details branch Sep 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquerydatatransfer cla: yes samples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants