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

Add BigQuery Table Constraints Field #8885

Merged
merged 2 commits into from
Sep 12, 2023

Conversation

obada-ab
Copy link
Contributor

@obada-ab obada-ab commented Sep 7, 2023

Add BigQuery Table Constraints Field
Fixes hashicorp/terraform-provider-google#15090

API: https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#TableConstraints

Release Note Template for Downstream PRs (will be copied)

bigquery: added `table_constraints` field to `google_bigquery_table` resource

@modular-magician
Copy link
Collaborator

Hello! I am a robot. It looks like you are a: Community Contributor Googler Core Contributor. Tests will run automatically.

@zli82016, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 3 files changed, 615 insertions(+))
Terraform Beta: Diff ( 3 files changed, 615 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3020
Passed tests 2719
Skipped tests: 297
Affected tests: 4

Action taken

Found 4 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccBigQueryTable_updateTableConstraints|TestAccBigQueryTable_ForeignKey|TestAccBigQueryTable_PrimaryKey|TestAccDataSourceGoogleServiceAccountIdToken_impersonation

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccBigQueryTable_updateTableConstraints[Debug log]
TestAccBigQueryTable_ForeignKey[Debug log]
TestAccBigQueryTable_PrimaryKey[Debug log]
TestAccDataSourceGoogleServiceAccountIdToken_impersonation[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{green}{\textsf{All tests passed!}}$
View the build log or the debug log for each test

@obada-ab
Copy link
Contributor Author

obada-ab commented Sep 7, 2023

/gcbrun

dataset_id = "%s"
}

resource "google_bigquery_table" "table_pk" {
Copy link
Member

@zli82016 zli82016 Sep 8, 2023

Choose a reason for hiding this comment

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

What is the reason to add resource google_bigquery_table.table_pk? It looks like resource google_bigquery_table.test is used as the testing resource by specifying resourceName := "google_bigquery_table.test".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@zli82016 A foreign key in a table needs to be linked to a primary key in another table. This is currently not enforced by BigQuery, however I added a primary key table anyway because this is the way it's intended to be used by users, and in case these constraints become enforced.

dataset_id = "%s"
}

resource "google_bigquery_table" "table_pk" {
Copy link
Member

@zli82016 zli82016 Sep 8, 2023

Choose a reason for hiding this comment

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

What is the reason to add resource google_bigquery_table.table_pk?

@zli82016
Copy link
Member

zli82016 commented Sep 8, 2023

The failure of unit tests is unrelated to this PR.

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 3 files changed, 615 insertions(+))
Terraform Beta: Diff ( 3 files changed, 615 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3030
Passed tests 2732
Skipped tests: 297
Affected tests: 1

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccBigQueryTable_updateTableConstraints

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccBigQueryTable_updateTableConstraints[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{green}{\textsf{All tests passed!}}$
View the build log or the debug log for each test

Copy link
Member

@zli82016 zli82016 left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks.

@zli82016 zli82016 merged commit 7e5d5d1 into GoogleCloudPlatform:main Sep 12, 2023
12 checks passed
RileyHYZ pushed a commit to RileyHYZ/magic-modules that referenced this pull request Sep 15, 2023
* Add BigQuery Table Constraints Field

* fix indentation for resource_bigquery_table_test
joelkattapuram pushed a commit to joelkattapuram/magic-modules that referenced this pull request Sep 20, 2023
* Add BigQuery Table Constraints Field

* fix indentation for resource_bigquery_table_test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

google_bigquery_table should support table constraints
3 participants