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

🐛 BigQuery Destination failed conditional binding #12068

Merged
merged 8 commits into from
Apr 15, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import io.airbyte.integrations.destination.bigquery.uploader.BigQueryUploaderFactory;
import io.airbyte.integrations.destination.bigquery.uploader.UploaderType;
import io.airbyte.integrations.destination.bigquery.uploader.config.UploaderConfig;
import io.airbyte.integrations.destination.gcs.GcsDestination;
import io.airbyte.integrations.destination.gcs.GcsDestinationConfig;
import io.airbyte.integrations.destination.gcs.GcsNameTransformer;
import io.airbyte.integrations.destination.gcs.GcsStorageOperations;
Expand Down Expand Up @@ -135,12 +136,12 @@ public AirbyteConnectionStatus checkStorageIamPermissions(final JsonNode config)
.toList();

if (!missingPermissions.isEmpty()) {
LOGGER.error("Please make sure you account has all of these permissions:{}", REQUIRED_PERMISSIONS);
LOGGER.warn("Please make sure you account has all of these permissions:{}", REQUIRED_PERMISSIONS);
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 add a comment here on why are we doing it this way. The comment can explain that the above approach doesnt work when people use conditional binding for permission handling on their GCS bcuket and that's why we have to do it this way

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you add a comment here on why are we doing it this way. The comment can explain that the above approach doesnt work when people use conditional binding for permission handling on their GCS bcuket and that's why we have to do it this way

added comment


final GcsDestination gcsDestination = new GcsDestination();
final JsonNode gcsJsonNodeConfig = BigQueryUtils.getGcsJsonNodeConfig(config);
return gcsDestination.check(gcsJsonNodeConfig);

return new AirbyteConnectionStatus()
.withStatus(AirbyteConnectionStatus.Status.FAILED)
.withMessage("Could not connect to the Gcs bucket with the provided configuration. "
+ "Missing permissions: " + missingPermissions);
}
return new AirbyteConnectionStatus().withStatus(Status.SUCCEEDED);

Expand Down
1 change: 1 addition & 0 deletions docs/integrations/destinations/bigquery.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ This uploads data directly from your source to BigQuery. While this is faster to

| Version | Date | Pull Request | Subject |
|:--------| :--- | :--- | :--- |
| 1.1.1 | 2022-04-15 | [12068](https://github.com/airbytehq/airbyte/pull/12068) | Fixed bug with GCS bucket conditional binding |
| 1.1.0 | 2022-04-06 | [11776](https://github.com/airbytehq/airbyte/pull/11776) | Use serialized buffering strategy to reduce memory consumption. |
| 1.0.2 | 2022-03-30 | [11620](https://github.com/airbytehq/airbyte/pull/11620) | Updated spec |
| 1.0.1 | 2022-03-24 | [11350](https://github.com/airbytehq/airbyte/pull/11350) | Improve check performance |
Expand Down