Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

docs(samples): add run details #334

Merged
merged 3 commits into from Sep 17, 2020

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 a team September 9, 2020 15:52
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Sep 9, 2020
@pmakani pmakani added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 9, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 9, 2020
Comment on lines 31 to 33
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
Contributor

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";

Copy link

@lesv lesv left a comment

Choose a reason for hiding this comment

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

Consider the comments.

Comment on lines +42 to +44
} catch (ApiException ex) {
System.out.print("Run details not found." + ex.toString());
}
Copy link

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

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

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 Issues related to the googleapis/java-bigquerydatatransfer API. label Sep 10, 2020
@pmakani pmakani added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 11, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 11, 2020
@stephaniewang526
Copy link
Contributor

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 Indicates a pull request not ready for merge, due to either quality or timing. label Sep 11, 2020
@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label Sep 12, 2020
@stephaniewang526
Copy link
Contributor

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 Indicates a pull request not ready for merge, due to either quality or timing. label Sep 17, 2020
@codecov
Copy link

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
@pmakani pmakani deleted the run-details branch September 18, 2020 16:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api: bigquerydatatransfer Issues related to the googleapis/java-bigquerydatatransfer API. cla: yes This human has signed the Contributor License Agreement. samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants