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

migrate bigquerydataset to new API #3125

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xiaoweim
Copy link
Collaborator

@xiaoweim xiaoweim commented Nov 7, 2024

The New BigQuery API does not support the field isCaseSensitive.

  • Run make ready-pr to ensure this PR is ready for review.
  • Perform necessary E2E testing for changed resources.

Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign cheftako for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@xiaoweim xiaoweim force-pushed the migrate_bigquerydataset_new_API branch 4 times, most recently from b4ebd5e to 956f9e8 Compare November 12, 2024 22:41
@xiaoweim xiaoweim changed the title [WIP] migration bigquerydataset to new API migrate bigquerydataset to new API Nov 12, 2024
@xiaoweim
Copy link
Collaborator Author

/assign @jingyih

out.Location = direct.ValueOf(in.Location)
out.IsCaseInsensitive = direct.ValueOf(in.IsCaseInsensitive)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Did you get a chance to find out the existing usage of this field?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I can only find out the usage of the resource, but not specific field :(. I just a YAQS question to the bigquery team, hopefully I can get an answer. If this field is too important, we might have to hold off migrating to the recommended API.

@@ -253,15 +269,16 @@ func (a *Adapter) Update(ctx context.Context, updateOp *directbase.UpdateOperati
if desired.Access == nil || len(desired.Access) == 0 {
resource.Access = a.actual.Access
}
updateDatasetCall := a.gcpService.Datasets.Update(parent.ProjectID, datasetId, resource)
updated, err := updateDatasetCall.Do()
datasetMetadataToUpdate := BigQueryDatasetMetadata_ToMetadataToUpdate(mapCtx, resource)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure if it is possible/easier to convert directly from krm.BigQueryDatasetSpec to pb.DatasetMetadataToUpdate in "Update". I feel it might be easier to read and maintain in the future.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This update does not support updateMask, so I would still need to go through all the non-immutable fields and update the clone of the a.actual object.

I could convert the desired object directly from krm.BigQueryDatasetSpec to pb.DatasetMetadataToUpdate. But I think the problem is that a.actual is of type pb.DatasetMetadata. After I updated the a.actual object with new values from the desired object, I would still need to convert it to pb.DatasetMetadataToUpdate.

tests/e2e/unified_test.go Outdated Show resolved Hide resolved
@xiaoweim xiaoweim force-pushed the migrate_bigquerydataset_new_API branch from fe0c30a to f8e8acd Compare November 14, 2024 02:02
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.

2 participants