File tree 4 files changed +19
-3
lines changed
airbyte-cdk/java/airbyte-cdk
main/kotlin/io/airbyte/integrations/base/destination/typing_deduping
test/kotlin/io/airbyte/integrations/base/destination/typing_deduping
4 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -174,6 +174,7 @@ corresponds to that version.
174
174
175
175
| Version | Date | Pull Request | Subject |
176
176
| :--------| :--------- | :--------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------- |
177
+ | 0.40.2 | 2024-06-18 | [ \# 39552] ( https://github.com/airbytehq/airbyte/pull/39552 ) | Destinations: Throw error if the ConfiguredCatalog has no streams |
177
178
| 0.40.1 | 2024-06-14 | [ \# 39349] ( https://github.com/airbytehq/airbyte/pull/39349 ) | Source stats for full refresh streams |
178
179
| 0.40.0 | 2024-06-17 | [ \# 38622] ( https://github.com/airbytehq/airbyte/pull/38622 ) | Destinations: Implement refreshes logic in AbstractStreamOperation |
179
180
| 0.39.0 | 2024-06-17 | [ \# 38067] ( https://github.com/airbytehq/airbyte/pull/38067 ) | Destinations: Breaking changes for refreshes (fail on INCOMPLETE stream status; ignore OVERWRITE sync mode) |
Original file line number Diff line number Diff line change 1
- version =0.40.1
1
+ version =0.40.2
Original file line number Diff line number Diff line change @@ -25,10 +25,16 @@ constructor(
25
25
private val defaultNamespace: String ,
26
26
private val rawNamespace: String = JavaBaseConstants .DEFAULT_AIRBYTE_INTERNAL_NAMESPACE ,
27
27
) {
28
- fun parseCatalog (orginalCatalog : ConfiguredAirbyteCatalog ): ParsedCatalog {
28
+ fun parseCatalog (originalCatalog : ConfiguredAirbyteCatalog ): ParsedCatalog {
29
+ if (originalCatalog.streams.isEmpty()) {
30
+ throw ConfigErrorException (
31
+ " The catalog contained no streams. This likely indicates a platform/configuration error."
32
+ )
33
+ }
34
+
29
35
// Don't mutate the original catalog, just operate on a copy of it
30
36
// This is... probably the easiest way we have to deep clone a protocol model object?
31
- val catalog = Jsons .clone(orginalCatalog )
37
+ val catalog = Jsons .clone(originalCatalog )
32
38
catalog.streams.onEach {
33
39
// Overwrite null namespaces
34
40
if (it.stream.namespace.isNullOrEmpty()) {
Original file line number Diff line number Diff line change 4
4
package io.airbyte.integrations.base.destination.typing_deduping
5
5
6
6
import com.fasterxml.jackson.databind.JsonNode
7
+ import io.airbyte.commons.exceptions.ConfigErrorException
7
8
import io.airbyte.commons.json.Jsons
8
9
import io.airbyte.protocol.models.v0.AirbyteStream
9
10
import io.airbyte.protocol.models.v0.ConfiguredAirbyteCatalog
@@ -12,6 +13,7 @@ import io.airbyte.protocol.models.v0.DestinationSyncMode
12
13
import io.airbyte.protocol.models.v0.SyncMode
13
14
import org.junit.jupiter.api.Assertions
14
15
import org.junit.jupiter.api.Assertions.assertAll
16
+ import org.junit.jupiter.api.Assertions.assertThrows
15
17
import org.junit.jupiter.api.BeforeEach
16
18
import org.junit.jupiter.api.Test
17
19
import org.mockito.Mockito
@@ -48,6 +50,13 @@ internal class CatalogParserTest {
48
50
parser = CatalogParser (sqlGenerator, " default_namespace" )
49
51
}
50
52
53
+ @Test
54
+ fun throwOnEmptyCatalog () {
55
+ assertThrows(ConfigErrorException ::class .java) {
56
+ parser.parseCatalog(ConfiguredAirbyteCatalog ().withStreams(emptyList()))
57
+ }
58
+ }
59
+
51
60
/* *
52
61
* Both these streams will write to the same final table name ("foofoo"). Verify that they don't
53
62
* actually use the same tablename.
You can’t perform that action at this time.
0 commit comments