-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into brian/zendesk_support_upgrade_to_concurrent
- Loading branch information
Showing
326 changed files
with
29,913 additions
and
12,100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
airbyte-cdk/bulk/core/base/src/main/resources/application.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
airbyte: | ||
file-transfer: | ||
enabled: ${USE_FILE_TRANSFER:false} | ||
staging-path: ${AIRBYTE_STAGING_DIRECTORY:/staging/files} |
40 changes: 40 additions & 0 deletions
40
...e-cdk/bulk/core/base/src/test/kotlin/io/airbyte/cdk/initialization/TestApplicationYaml.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright (c) 2024 Airbyte, Inc., all rights reserved. | ||
*/ | ||
|
||
package io.airbyte.cdk.initialization | ||
|
||
import io.micronaut.context.annotation.Bean | ||
import io.micronaut.context.annotation.Factory | ||
import io.micronaut.context.annotation.Value | ||
import io.micronaut.test.extensions.junit5.annotation.MicronautTest | ||
import jakarta.inject.Inject | ||
import kotlin.test.assertEquals | ||
import org.junit.jupiter.api.Test | ||
|
||
@MicronautTest | ||
class TestApplicationYaml { | ||
@Inject lateinit var defaultValueBean: DefaultValueBean | ||
|
||
@Test | ||
fun testMainDefaultValue() { | ||
assertEquals("/staging/files", defaultValueBean.stagingFolder) | ||
assertEquals(false, defaultValueBean.fileTransferEnable) | ||
} | ||
} | ||
|
||
data class DefaultValueBean( | ||
val stagingFolder: String, | ||
val fileTransferEnable: Boolean, | ||
) | ||
|
||
@Factory | ||
class TestFactory { | ||
@Bean | ||
fun defaultValueBean( | ||
@Value("\${airbyte.file-transfer.staging-path}") stagingFolder: String, | ||
@Value("\${airbyte.file-transfer.enabled}") fileTransferEnable: Boolean, | ||
): DefaultValueBean { | ||
return DefaultValueBean(stagingFolder, fileTransferEnable) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
...lk/core/load/src/main/kotlin/io/airbyte/cdk/load/data/AirbyteTypeToAirbyteTypeWithMeta.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* | ||
* Copyright (c) 2024 Airbyte, Inc., all rights reserved. | ||
*/ | ||
|
||
package io.airbyte.cdk.load.data | ||
|
||
import io.airbyte.cdk.load.message.DestinationRecord | ||
|
||
class AirbyteTypeToAirbyteTypeWithMeta(private val flatten: Boolean) { | ||
fun convert(schema: AirbyteType): ObjectType { | ||
val properties = | ||
linkedMapOf( | ||
DestinationRecord.Meta.COLUMN_NAME_AB_RAW_ID to | ||
FieldType(StringType, nullable = false), | ||
DestinationRecord.Meta.COLUMN_NAME_AB_EXTRACTED_AT to | ||
FieldType(IntegerType, nullable = false), | ||
DestinationRecord.Meta.COLUMN_NAME_AB_META to | ||
FieldType( | ||
nullable = false, | ||
type = | ||
ObjectType( | ||
linkedMapOf( | ||
"sync_id" to FieldType(IntegerType, nullable = false), | ||
"changes" to | ||
FieldType( | ||
nullable = false, | ||
type = | ||
ArrayType( | ||
FieldType( | ||
nullable = false, | ||
type = | ||
ObjectType( | ||
linkedMapOf( | ||
"field" to | ||
FieldType( | ||
StringType, | ||
nullable = false | ||
), | ||
"change" to | ||
FieldType( | ||
StringType, | ||
nullable = false | ||
), | ||
"reason" to | ||
FieldType( | ||
StringType, | ||
nullable = false | ||
), | ||
) | ||
) | ||
) | ||
) | ||
) | ||
) | ||
) | ||
), | ||
DestinationRecord.Meta.COLUMN_NAME_AB_GENERATION_ID to | ||
FieldType(IntegerType, nullable = false) | ||
) | ||
if (flatten) { | ||
(schema as ObjectType).properties.forEach { (name, field) -> properties[name] = field } | ||
} else { | ||
properties[DestinationRecord.Meta.COLUMN_NAME_DATA] = | ||
FieldType(schema, nullable = false) | ||
} | ||
return ObjectType(properties) | ||
} | ||
} | ||
|
||
fun AirbyteType.withAirbyteMeta(flatten: Boolean = false): ObjectType = | ||
AirbyteTypeToAirbyteTypeWithMeta(flatten).convert(this) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.