Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: ensure AccessEntry equality and repr uses the correct entity_type #2182

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

Merged
merged 2 commits into from
May 14, 2025

Conversation

tswast
Copy link
Contributor

@tswast tswast commented May 13, 2025

Discovered while updating the internal version of google-cloud-bigquery. Without this fix, it was causing this test to fail: https://github.com/dbt-labs/dbt-bigquery/blob/0995665e490cdee9c408d26aac8e1c19fefaebe0/tests/unit/test_dataset.py#L25

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)

Fixes #<issue_number_goes_here> 🦕

@tswast tswast requested review from a team as code owners May 13, 2025 18:28
@tswast tswast requested a review from agrawal-siddharth May 13, 2025 18:28
@product-auto-label product-auto-label bot added the size: s Pull request size is small. label May 13, 2025
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery API. label May 13, 2025
Copy link
Contributor Author

Choose a reason for hiding this comment

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

FYI: I did a mini-TDD for this. Both of these tests fail without the changes in dataset.py.

@@ -746,6 +755,13 @@ def test_dataset_property_with_condition(self, condition_1):
assert "dataset" in entry._properties
assert "condition" in entry._properties

def test_repr_from_api_repr(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please check the array of AccessEntry works too? The g3 failed tests show the None entity type in the array: https://screenshot.googleplex.com/B88hiRSwcAfeE49

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 0cfa704

Also verified that the added test fails until the changes in dataset.py.

Copy link
Collaborator

@chalmerlowe chalmerlowe left a comment

Choose a reason for hiding this comment

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

LGTM, Approved

@chalmerlowe chalmerlowe merged commit 0217637 into main May 14, 2025
18 checks passed
@chalmerlowe chalmerlowe deleted the tswast-accessentry-eq branch May 14, 2025 09:36
@chalmerlowe
Copy link
Collaborator

Thanks for submitting this PR. Much appreciated, Tim.

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: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants