Destination Bigquery: Even more handling for billing errors (#63700)
This commit is contained in:
@@ -6,7 +6,7 @@ data:
|
||||
connectorSubtype: database
|
||||
connectorType: destination
|
||||
definitionId: 22f6c74f-5699-40ff-833c-4a879ea40133
|
||||
dockerImageTag: 3.0.5
|
||||
dockerImageTag: 3.0.6
|
||||
dockerRepository: airbyte/destination-bigquery
|
||||
documentationUrl: https://docs.airbyte.com/integrations/destinations/bigquery
|
||||
githubIssueLabel: destination-bigquery
|
||||
|
||||
@@ -174,7 +174,7 @@ class BigQueryDatabaseHandler(private val bq: BigQuery, private val datasetLocat
|
||||
private fun wrapWithConfigExceptionIfNeeded(e: Exception): Exception {
|
||||
when (e) {
|
||||
is BigQueryException -> {
|
||||
if (e.reason.contains(BILLING_CONFIG_ERROR)) {
|
||||
if (e.errors.any { it.message.contains(BILLING_CONFIG_ERROR) }) {
|
||||
return ConfigErrorException(e.reason, e)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,20 +26,15 @@ class BigQueryDatabaseHandlerTest {
|
||||
fun `billing errors are wrapped as ConfigErrorException`() {
|
||||
val bqError = BigQueryError(BILLING_ERROR, "loc", BILLING_ERROR)
|
||||
val bq: BigQuery = mockk {
|
||||
every { create(any(JobInfo::class), *anyVararg()) } returns
|
||||
every { create(any(JobInfo::class), *anyVararg()).status } returns
|
||||
mockk {
|
||||
every { status } returns
|
||||
mockk {
|
||||
every { state } returns JobStatus.State.DONE
|
||||
every { error } returns bqError
|
||||
every { executionErrors } returns listOf(bqError)
|
||||
}
|
||||
every { state } returns JobStatus.State.DONE
|
||||
every { error } returns bqError
|
||||
every { executionErrors } returns listOf(bqError)
|
||||
}
|
||||
}
|
||||
val handler = BigQueryDatabaseHandler(bq, "location")
|
||||
|
||||
assertThrows<ConfigErrorException> {
|
||||
handler.execute(Sql(listOf(listOf("select * from nowhere"))))
|
||||
}
|
||||
assertThrows<ConfigErrorException> { handler.execute(Sql.of("select * from nowhere")) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,3 @@ dependencies {
|
||||
integrationTestImplementation 'org.testcontainers:clickhouse:1.21.1'
|
||||
integrationTestImplementation 'com.clickhouse:client-v2:0.9.0'
|
||||
}
|
||||
|
||||
test {
|
||||
systemProperties(["mockk.junit.extension.requireParallelTesting":"true"])
|
||||
}
|
||||
|
||||
@@ -57,7 +57,3 @@ dependencies {
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-params:$junitVersion")
|
||||
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitVersion")
|
||||
}
|
||||
|
||||
tasks.named<Test>("test") {
|
||||
systemProperties(mapOf("mockk.junit.extension.keepmocks" to "true", "mockk.junit.extension.requireParallelTesting" to "true"))
|
||||
}
|
||||
|
||||
@@ -63,7 +63,3 @@ dependencies {
|
||||
|
||||
integrationTestImplementation("org.testcontainers:mssqlserver:$testContainersVersion")
|
||||
}
|
||||
|
||||
tasks.named<Test>("test") {
|
||||
systemProperties(mapOf("mockk.junit.extension.keepmocks" to "true", "mockk.junit.extension.requireParallelTesting" to "true"))
|
||||
}
|
||||
|
||||
@@ -63,7 +63,3 @@ dependencies {
|
||||
integrationTestImplementation("com.squareup.okhttp3:okhttp:4.12.0")
|
||||
integrationTestImplementation("org.projectnessie.nessie:nessie-minio-testcontainer:0.101.1")
|
||||
}
|
||||
|
||||
test {
|
||||
systemProperties(["mockk.junit.extension.keepmocks":"true", "mockk.junit.extension.requireParallelTesting":"true"])
|
||||
}
|
||||
|
||||
@@ -266,6 +266,11 @@ class AirbyteBulkConnectorPlugin implements Plugin<Project> {
|
||||
testFixturesRuntimeOnly.extendsFrom runtimeOnly
|
||||
}
|
||||
|
||||
project.tasks.named('test').configure {
|
||||
// enable the "don't be evil" option, which for some reason is disabled by default
|
||||
systemProperties(["mockk.junit.extension.requireParallelTesting": "true"])
|
||||
}
|
||||
|
||||
project.extensions.create('airbyteBulkConnector', AirbyteBulkConnectorExtension, project)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -210,6 +210,7 @@ tutorials:
|
||||
|
||||
| Version | Date | Pull Request | Subject |
|
||||
|:------------|:-----------|:-----------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| 3.0.6 | 2025-07-21 | [63700](https://github.com/airbytehq/airbyte/pull/63700) | Improve error reporting for Billing errors. |
|
||||
| 3.0.5 | 2025-07-15 | [63312](https://github.com/airbytehq/airbyte/pull/63312) | Pull in upstream fix to support null chars in GCS staging mode. |
|
||||
| 3.0.4 | 2025-07-15 | [63327](https://github.com/airbytehq/airbyte/pull/63327) | Improve error reporting for Billing errors. |
|
||||
| 3.0.3 | 2025-07-02 | [62495](https://github.com/airbytehq/airbyte/pull/62495) | Improve error reporting for misconfigured connections; improve support for complex types. |
|
||||
|
||||
Reference in New Issue
Block a user