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

fix: datasetRef is not a required field in BigQueryDataTransferConfig #3777

Conversation

jingyih
Copy link
Collaborator

@jingyih jingyih commented Feb 25, 2025

Fix: #3772

@@ -291,7 +291,7 @@ func (a *Adapter) Update(ctx context.Context, updateOp *directbase.UpdateOperati
if !reflect.DeepEqual(desired.DataSourceId, a.actual.DataSourceId) {
return fmt.Errorf("BigQueryDataTransferConfig %s/%s data source ID cannot be changed", u.GetNamespace(), u.GetName())
}
if !reflect.DeepEqual(desired.Destination, a.actual.Destination) {
if desired.Destination != nil && !reflect.DeepEqual(desired.Destination, a.actual.Destination) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just curious, is there a generated destination if it is unspecified by the user?

Copy link
Collaborator Author

@jingyih jingyih Feb 25, 2025

Choose a reason for hiding this comment

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

I don't think so. But let me run the test against real GCP to double check.

update: Just tried. No, the service will not generate the destination.

@@ -283,6 +129,7 @@ X-Xss-Protection: 0
"write_disposition": "WRITE_APPEND"
},
"schedule": "first sunday of quarter 00:00",
"state": 2,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just curious, is this added state the result of not setting destinationDatasetId?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch. I am actually not sure. The "state" is hardcoded as PENDING (2) in the mock. Not sure why it was missing in the previous http log.

obj.State = pb.TransferState_PENDING

@yuwenma
Copy link
Collaborator

yuwenma commented Feb 25, 2025

/lgtm
/approve

Do you happen to know why we introduce the "required" flag to the datasetRef field? is that from a GCP change?

Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: yuwenma

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow google-oss-prow bot merged commit afd21ab into GoogleCloudPlatform:master Feb 25, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BigQueryDataTransferConfig datasetRef required but not by the API / UI
3 participants