GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add Data Catalog createEntry samples and tests. by mesmacosta · Pull Request #1638 · GoogleCloudPlatform/java-docs-samples

Conversation

@mesmacosta

@mesmacosta mesmacosta commented Oct 22, 2019

Copy link
Copy Markdown
Contributor

I would like to add samples for Data Catalog create_entry method, released on 0.28.0-alpha google-cloud-datacatalog version.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mesmacosta
Add Data Catalog createEntry samples and tests
a9b5c7e
@mesmacosta
mesmacosta requested a review from a team October 22, 2019 21:02
@blunderbuss-gcf blunderbuss-gcf Bot assigned kurtisvg Oct 22, 2019
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Oct 22, 2019
@mesmacosta
Change second column name
3842dd6
@kurtisvg

kurtisvg commented Oct 23, 2019

Copy link
Copy Markdown
Contributor

I would like to add samples for Data Catalog create_entry method, released on 0.28.0-alpha google-cloud-datacatalog version.

Are these samples being authored with the intent to include them as part of our docs somewhere? or are you just writing them because you thought the current set of samples is missing this functionality?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mesmacosta

mesmacosta commented Oct 23, 2019

Copy link
Copy Markdown
Contributor Author

Hi @kurtisvg,

yes, they are being authored with the intent to include them as part of google docs.

And also the current set of samples is missing this functionality.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

kurtisvg
kurtisvg suggested changes Oct 23, 2019
View reviewed changes
Comment thread datacatalog/cloud-client/src/main/java/com/example/datacatalog/CreateFilesetEntry.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread datacatalog/cloud-client/src/main/java/com/example/datacatalog/CreateFilesetEntry.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread datacatalog/cloud-client/src/main/java/com/example/datacatalog/CreateFilesetEntry.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread datacatalog/cloud-client/src/main/java/com/example/datacatalog/CreateFilesetEntry.java Outdated
try {
dataCatalogClient.deleteEntry(
EntryName.of(projectId, location, entryGroupId, entryId).toString());
} catch (Exception e) {

@kurtisvg kurtisvg Oct 23, 2019

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

You shouldn't catch Exception - you should catch the specific error being thrown and show the user how to handle it correctly.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@mesmacosta mesmacosta Oct 23, 2019

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Removed, will add new PRs for delete methods.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread datacatalog/cloud-client/src/main/java/com/example/datacatalog/CreateFilesetEntry.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread datacatalog/cloud-client/src/main/java/com/example/datacatalog/CreateFilesetEntry.java Outdated
// Delete any pre-existing Entry Group with the same name
// that will be used in step 2.
try {
dataCatalogClient.deleteEntryGroup(

@kurtisvg kurtisvg Oct 23, 2019

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Same as comments above.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@mesmacosta mesmacosta Oct 23, 2019

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Removed, will add new PRs for delete methods.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread datacatalog/cloud-client/src/main/java/com/example/datacatalog/CreateFilesetEntry.java Outdated
System.out.printf("\nEntry created with name: %s\n", entryResponse.getName());


} catch (Exception e) {

@kurtisvg kurtisvg Oct 23, 2019

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

This Exception is too broad as well.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@mesmacosta mesmacosta Oct 23, 2019

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Changed, also now explaining what could cause the exceptions.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread datacatalog/cloud-client/src/test/java/com/example/datacatalog/CreateFilesetEntryTests.java Outdated

private static String PROJECT_ID = System.getenv().get("GOOGLE_CLOUD_PROJECT");
private static String LOCATION = "us-central1";
private static String ENTRY_GROUP_ID = "fileset_entry_group";

@kurtisvg kurtisvg Oct 23, 2019

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

these should probably use a randomly generated UUID.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@mesmacosta mesmacosta Oct 23, 2019

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Changed, using only the first 8 chars from UUID, since hyphens are not supported on those IDs.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread datacatalog/cloud-client/src/main/java/com/example/datacatalog/CreateFilesetEntry.java Outdated
Entry entry = Entry.newBuilder()
.setDisplayName("My Fileset")
.setDescription("This fileset consists of ....")
.setGcsFilesetSpec(GcsFilesetSpec.newBuilder().addFilePatterns("gs://my_bucket/*")

@kurtisvg kurtisvg Oct 23, 2019

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Generally we try to prioritize splitting between different syntactic levels, and remain consistent:

              .setGcsFilesetSpec(
                  GcsFilesetSpec.newBuilder().addFilePatterns("gs://my_bucket/*").build())

Or, if the line is too long:

              .setGcsFilesetSpec(
                  GcsFilesetSpec.newBuilder()
                     .addFilePatterns("gs://my_bucket/*")
                     .build())

You can use google-java-format to format the entire file at once.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@mesmacosta mesmacosta Oct 23, 2019

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Ran google-java-format, could you check?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@kurtisvg kurtisvg added the kokoro:run Add this label to force Kokoro to re-run the tests. label Oct 23, 2019
@kokoro-team kokoro-team removed the kokoro:run Add this label to force Kokoro to re-run the tests. label Oct 23, 2019
mesmacosta and others added 2 commits October 23, 2019 17:09
@mesmacosta
Code review changes
8b12149
@mesmacosta
Merge branch 'master' into task/add-create-fileset-entry
7ad0bc8
@mesmacosta
mesmacosta requested a review from kurtisvg October 23, 2019 20:15
@kurtisvg kurtisvg added the kokoro:run Add this label to force Kokoro to re-run the tests. label Oct 23, 2019
@kokoro-team kokoro-team removed the kokoro:run Add this label to force Kokoro to re-run the tests. label Oct 23, 2019
mesmacosta added 3 commits October 23, 2019 18:04
@mesmacosta
Change region tag for the correct one
daf17bd
@mesmacosta
Merge branch 'task/add-create-fileset-entry' of https://github.com/me…
dc6daea
…smacosta/java-docs-samples into task/add-create-fileset-entry
@mesmacosta
Removed tag from region tag since this sample does not tag the entry
6f7d709
kurtisvg
kurtisvg suggested changes Oct 23, 2019
View reviewed changes
Comment thread datacatalog/cloud-client/src/main/java/com/example/datacatalog/CreateFilesetEntry.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread datacatalog/cloud-client/src/main/java/com/example/datacatalog/CreateFilesetEntry.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread datacatalog/cloud-client/src/main/java/com/example/datacatalog/CreateFilesetEntry.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread datacatalog/cloud-client/src/main/java/com/example/datacatalog/CreateFilesetEntry.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread datacatalog/cloud-client/src/main/java/com/example/datacatalog/CreateFilesetEntry.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread datacatalog/cloud-client/src/main/java/com/example/datacatalog/CreateFilesetEntry.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

mesmacosta added 2 commits October 23, 2019 18:57
@mesmacosta
ADD method overload to show parameter values examples
804612d
@mesmacosta
Code review changes
6cb3466
@mesmacosta
mesmacosta requested a review from kurtisvg October 24, 2019 19:40
mesmacosta added 2 commits October 24, 2019 16:49
@mesmacosta
Merge branch 'master' into task/add-create-fileset-entry
69fb80c
@mesmacosta
Merge branch 'master' into task/add-create-fileset-entry
412ad13
@kurtisvg kurtisvg added the kokoro:run Add this label to force Kokoro to re-run the tests. label Oct 25, 2019
@kokoro-team kokoro-team removed the kokoro:run Add this label to force Kokoro to re-run the tests. label Oct 25, 2019
kurtisvg
kurtisvg suggested changes Oct 25, 2019
View reviewed changes
Comment thread datacatalog/cloud-client/src/main/java/com/example/datacatalog/CreateFilesetEntry.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread datacatalog/cloud-client/src/main/java/com/example/datacatalog/CreateFilesetEntry.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread datacatalog/cloud-client/src/test/java/com/example/datacatalog/CreateEntryGroupTests.java Outdated

/** Integration (system) tests for {@link CreateEntryGroup}. */
@RunWith(JUnit4.class)
@SuppressWarnings("checkstyle:abbreviationaswordinname")

@kurtisvg kurtisvg Oct 25, 2019

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Can you remove this line? We should try to avoid suppression style checks.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@mesmacosta mesmacosta Oct 25, 2019

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

removed

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread datacatalog/cloud-client/src/test/java/com/example/datacatalog/CreateEntryGroupTests.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@mesmacosta
Code review changes
1cb15ce
@mesmacosta
mesmacosta requested a review from kurtisvg October 25, 2019 18:27
@mesmacosta
Merge branch 'master' into task/add-create-fileset-entry
672343b
@kurtisvg kurtisvg added the kokoro:run Add this label to force Kokoro to re-run the tests. label Oct 25, 2019
@kokoro-team kokoro-team removed the kokoro:run Add this label to force Kokoro to re-run the tests. label Oct 25, 2019
kurtisvg
kurtisvg suggested changes Oct 25, 2019
View reviewed changes
Comment thread datacatalog/cloud-client/src/test/java/com/example/datacatalog/CreateFilesetEntryTests.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@mesmacosta
Code review and checkstyle changes
8df1a03
@mesmacosta
mesmacosta requested a review from kurtisvg October 25, 2019 21:46
@kurtisvg kurtisvg added the kokoro:run Add this label to force Kokoro to re-run the tests. label Oct 25, 2019
@kokoro-team kokoro-team removed the kokoro:run Add this label to force Kokoro to re-run the tests. label Oct 25, 2019
kurtisvg
kurtisvg approved these changes Oct 25, 2019
View reviewed changes

@kurtisvg kurtisvg left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM once tests pass

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mesmacosta
Clean up in a safer order
0b12da2
@kurtisvg kurtisvg added the kokoro:run Add this label to force Kokoro to re-run the tests. label Oct 25, 2019
@kokoro-team kokoro-team removed the kokoro:run Add this label to force Kokoro to re-run the tests. label Oct 25, 2019
@mesmacosta
mesmacosta requested a review from kurtisvg October 26, 2019 12:32
@kurtisvg

kurtisvg commented Oct 26, 2019

Copy link
Copy Markdown
Contributor

Hi @mesmacosta,

This already has my approval. Do you need me to merge it for you?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mesmacosta

mesmacosta commented Oct 26, 2019

Copy link
Copy Markdown
Contributor Author

Yes @kurtisvg, can you do that?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kurtisvg
kurtisvg merged commit ce81ede into GoogleCloudPlatform:master Oct 26, 2019
@mesmacosta
mesmacosta deleted the task/add-create-fileset-entry branch October 28, 2019 13:00
bradmiro pushed a commit that referenced this pull request Dec 2, 2019
@mesmacosta @bradmiro
Add Data Catalog createEntry samples and tests. (#1638)
f04bb69
* Add Data Catalog createEntry samples and tests

* Change second column name

* Code review changes

* Change region tag for the correct one

* Removed tag from region tag since this sample does not tag the entry

* ADD method overload to show parameter values examples

* Code review changes

* Code review changes

* Code review and checkstyle changes

* Clean up in a safer order
@charlieyu1996 charlieyu1996 mentioned this pull request Nov 11, 2022
migrate code from googleapis/java-datacatalog #7412
Merged
9 tasks
charlieyu1996 pushed a commit that referenced this pull request Nov 11, 2022
@mesmacosta @chingor13
samples: Add Data Catalog createEntry samples and tests. (#1638)
4ac2639
* Add Data Catalog createEntry samples and tests

* Change second column name

* Code review changes

* Change region tag for the correct one

* Removed tag from region tag since this sample does not tag the entry

* ADD method overload to show parameter values examples

* Code review changes

* Code review changes

* Code review and checkstyle changes

* Clean up in a safer order
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@kurtisvg kurtisvg Awaiting requested review from kurtisvg

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@kurtisvg kurtisvg

Labels

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

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@mesmacosta @kurtisvg @googlebot @kokoro-team
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.