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

docs(samples): Add sample for PolicyTagManagerClient.create_taxonomy #37

Merged
merged 10 commits into from Dec 28, 2021

Conversation

ricardolsmendes
Copy link
Contributor

@ricardolsmendes ricardolsmendes commented May 29, 2020

  • 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)

Fixes #36 🦕

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label May 29, 2020
@ricardolsmendes ricardolsmendes changed the title Add a PolicyTagManagerClient.create_taxonomy sample Add sample for PolicyTagManagerClient.create_taxonomy May 29, 2020
@ricardolsmendes
Copy link
Contributor Author

The test created in https://github.com/googleapis/python-datacatalog/pull/37/files#diff-846e070615bad825160d9d5aae12529d will make nox -s samples-2.7 and nox -s samples-3.7 fail until #33 is fixed.

@product-auto-label product-auto-label bot added the api: datacatalog Issues related to the googleapis/python-datacatalog API. label Aug 21, 2020
@meredithslota
Copy link
Contributor

#33 is still not fixed due to backend issues, we are keeping tabs on it internally.

@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label Sep 12, 2020
@ricardolsmendes ricardolsmendes requested review from busunkim96 and removed request for a team December 15, 2020 02:05
Copy link
Contributor

@tswast tswast left a comment

Choose a reason for hiding this comment

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

Apologies for the delay. I can hopefully review more thoroughly soon.

Could you please move this sample and tests to https://github.com/googleapis/python-datacatalog/tree/master/samples/snippets ? That will ensure it is getting tested by our latest samples templates.

@snippet-bot
Copy link

snippet-bot bot commented Jan 7, 2021

Here is the summary of changes.

You are about to add 1 region tag.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@ricardolsmendes
Copy link
Contributor Author

Could you please move this sample and tests to https://github.com/googleapis/python-datacatalog/tree/master/samples/snippets ? That will ensure it is getting tested by our latest samples templates.

Hi @tswast, I've moved create_taxonomy.py and create_taxonomy_test.py to samples/snippets, but I'm not sure about what should I do with samples/tests/conftest.py. Also, I was not able to test the snippets locally. Could you advise, please?

@tswast
Copy link
Contributor

tswast commented Jan 7, 2021

samples/tests/conftest.py

This file can also be moved to samples/snippets/. Latest guidelines are to have all test code in the same directory as the sample code.

I was not able to test the snippets locally. Could you advise, please?

Do you still have nox installed? You should be able to cd to the samples/snippets directory and run nox from there. See https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/AUTHORING_GUIDE.md for a very detailed guide.

@tswast
Copy link
Contributor

tswast commented Jan 7, 2021

(Snippet Bot): There is a possible violation for not having product prefix. samples/snippets/create_taxonomy.py:18, tag datacatalog_create_taxonomy_tag

This should be data_catalog_ptm_create_taxonomy to match https://github.com/GoogleCloudPlatform/golang-samples/blob/05c7ba5165b234994806cd96c789b6611100adad/datacatalog/snippets/policytagmanager/create_taxonomy.go#L17-L61

@tmatsuo
Copy link
Contributor

tmatsuo commented Jan 7, 2021

@tswast is correct. The bot also thinks data_catalog is the correct region tag prefix.

@ricardolsmendes
Copy link
Contributor Author

Thanks, @tswast and @tmatsuo!
I was able to successfully test the snippet with both nox -s py-3.6 -- data_catalog_ptm_create_taxonomy_test.py and nox -s py-3.8 -- data_catalog_ptm_create_taxonomy_test.py. Please let me know if I can help with anything else. Best,

@ricardolsmendes
Copy link
Contributor Author

ricardolsmendes commented Jan 7, 2021

[EDITED]
Please notice I needed to create a object Display Name using fixtures. So, in the teardown stage, I can check it and delete the Taxonomy created by the test. Different from other Data Catalog endpoints, that allow us to generate an id and provide the name when creating a resource, create_taxonomy seems to generate the id and hence the resource name, so I cannot rely on a previously known id to delete the resource. Makes sense? 🤔

@parthea parthea changed the title Add sample for PolicyTagManagerClient.create_taxonomy docs(samples): Add sample for PolicyTagManagerClient.create_taxonomy Sep 27, 2021
@parthea parthea added the kokoro:run Add this label to force Kokoro to re-run the tests. label Nov 8, 2021
@yoshi-kokoro yoshi-kokoro removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Nov 8, 2021
@parthea parthea added kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. labels Nov 13, 2021
@yoshi-kokoro yoshi-kokoro removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Nov 13, 2021
@tswast tswast added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 21, 2021
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 21, 2021
@tswast tswast added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 28, 2021
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 28, 2021
@tswast tswast added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 28, 2021
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 28, 2021
@tswast tswast added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 28, 2021
@yoshi-kokoro yoshi-kokoro removed kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Dec 28, 2021
@tswast tswast merged commit 15feb5d into googleapis:main Dec 28, 2021
@ricardolsmendes ricardolsmendes deleted the add-sample-create-taxonomy branch December 28, 2021 20:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api: datacatalog Issues related to the googleapis/python-datacatalog 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.

There is no sample code for PolicyTagManagerClient.create_taxonomy
8 participants