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

feat: resource tags in dataset #2090

Merged
merged 24 commits into from
Jan 14, 2025

Conversation

keunsoopark
Copy link
Contributor

@keunsoopark keunsoopark commented Dec 19, 2024

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

Fixes #2091 🦕

@keunsoopark keunsoopark requested review from a team as code owners December 19, 2024 13:26
@product-auto-label product-auto-label bot added the size: m Pull request size is medium. label Dec 19, 2024
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery API. label Dec 19, 2024
@keunsoopark keunsoopark marked this pull request as draft December 19, 2024 13:50
@keunsoopark keunsoopark marked this pull request as ready for review December 19, 2024 13:50
@keunsoopark keunsoopark marked this pull request as draft December 19, 2024 15:38
@keunsoopark keunsoopark marked this pull request as ready for review December 19, 2024 15:38
Copy link
Contributor

@Linchin Linchin left a comment

Choose a reason for hiding this comment

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

Thank you so much for adding resource tags in dataset! The PR looks great overall, I just made some minor modifications. I wonder if you could add a system test, as well as a unit test for setter with None? Please let us know if you need any help. Happy holidays!

@Linchin Linchin added 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 Dec 20, 2024
@Linchin Linchin assigned Linchin and unassigned yirutang Dec 20, 2024
@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 Dec 20, 2024
@keunsoopark
Copy link
Contributor Author

system test

Hi @Linchin, thanks for the review.

I added system tests in system/test_clients.py

I fixed unittests for None, and added more tests for invalid values. See test_resource_tags_setter_bad_value.

Merry Christmas and happy new year!

@Linchin
Copy link
Contributor

Linchin commented Jan 14, 2025

Thank you for the prompt reply! Adding a prefix lgtm. I think there was something wrong with the test infra, I hope it's just flaky and doesn't happen again.

@Linchin Linchin added 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 Jan 14, 2025
@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 Jan 14, 2025
@Linchin Linchin added 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 Jan 14, 2025
@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 Jan 14, 2025
@Linchin Linchin added 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 Jan 14, 2025
@Linchin Linchin self-requested a review January 14, 2025 20:59
@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 Jan 14, 2025
Copy link
Contributor

@Linchin Linchin left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution, now all tests have passed! 🎉

LGTM.

@Linchin Linchin added 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 Jan 14, 2025
@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 Jan 14, 2025
@Linchin Linchin merged commit 3e13016 into googleapis:main Jan 14, 2025
16 checks passed
@keunsoopark keunsoopark deleted the feat/resource_tags_in_dataset branch January 14, 2025 21:18
@keunsoopark
Copy link
Contributor Author

keunsoopark commented Jan 14, 2025

Thank you for your contribution, now all tests have passed! 🎉

LGTM.

Thank you so much! It was a pleasant review process with you, @Linchin :)
My motivation to this contribution is for making dbt able to attach resource tags - dbt-labs/dbt-adapters#577. As you see in this issue, it requires this functionality on tables as well.
I am looking forward to other PR - #2093 done soon, but if it takes too long time to get response, I can contribute it as well. Now I can fix this feature pretty quickly :)
Just ping me if you want me to be involved.

@Linchin
Copy link
Contributor

Linchin commented Jan 14, 2025

It was a pleasure working with you! @keunsoopark

Let's first see if the original author of #2093 responses, then we can decide what to do next.

chalmerlowe pushed a commit that referenced this pull request Jan 22, 2025
* feat: resource tags in dataset

* fix: fix unittets

* Delete dataset/pyvenv.cfg

* Update google/cloud/bigquery/dataset.py

Co-authored-by: Lingqing Gan <[email protected]>

* Update google/cloud/bigquery/dataset.py

Co-authored-by: Lingqing Gan <[email protected]>

* added system tests & fix unittest for none

* add missing assert

* remove venv

* include resourcemanager in noxfile.py

* fix fixture for tag keys

* register tags before using in tests

* handle alreadyexist error

* fix: tag keys & values creation & deletion

* fix comment

* make tag keys unique

* remove unused import

---------

Co-authored-by: Lingqing Gan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery API. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Attach resource tags on datasets
4 participants