diff --git a/protocol-models/src/main/java/io/airbyte/protocol/models/CatalogHelpers.java b/protocol-models/src/main/java/io/airbyte/protocol/models/CatalogHelpers.java index df9c624..6756a3f 100644 --- a/protocol-models/src/main/java/io/airbyte/protocol/models/CatalogHelpers.java +++ b/protocol-models/src/main/java/io/airbyte/protocol/models/CatalogHelpers.java @@ -377,7 +377,7 @@ public static Set getCatalogDiff(final AirbyteCatalog oldCatalo && s.getStream().getName().equals(descriptor.getName())) .findFirst(); - if (!streamOld.equals(streamNew)) { + if (!streamOld.equals(streamNew) && stream.isPresent()) { // getStreamDiff only checks for differences in the stream's field name or field type // but there are a number of reasons the streams might be different (such as a source-defined // primary key or cursor changing). These should not be expressed as "stream updates". diff --git a/protocol-models/src/test/java/io/airbyte/protocol/models/CatalogHelpersTest.java b/protocol-models/src/test/java/io/airbyte/protocol/models/CatalogHelpersTest.java index 97bde7a..63ba490 100644 --- a/protocol-models/src/test/java/io/airbyte/protocol/models/CatalogHelpersTest.java +++ b/protocol-models/src/test/java/io/airbyte/protocol/models/CatalogHelpersTest.java @@ -278,13 +278,8 @@ void testCatalogDiffWithoutStreamConfig() throws IOException { final Set diff = CatalogHelpers.getCatalogDiff(catalog1, catalog2, configuredAirbyteCatalog); - final List expectedDiff = Stream.of( - StreamTransform.createUpdateStreamTransform(new StreamDescriptor().withName(USERS), new UpdateStreamTransform(Set.of( - FieldTransform.createRemoveFieldTransform(List.of(DATE), schema1.get(PROPERTIES).get(DATE), false), - FieldTransform.createRemoveFieldTransform(List.of("id"), schema1.get(PROPERTIES).get("id"), false))))) - .toList(); - - Assertions.assertThat(diff).containsAll(expectedDiff); + //configuredCatalog is for a different stream, so no diff should be found + Assertions.assertThat(diff).hasSize(0); } @Test