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

fix: only add user selected streams to the catalog diff #53

Merged
merged 4 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -377,7 +377,7 @@ public static Set<StreamTransform> 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".
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,13 +278,8 @@ void testCatalogDiffWithoutStreamConfig() throws IOException {

final Set<StreamTransform> diff = CatalogHelpers.getCatalogDiff(catalog1, catalog2, configuredAirbyteCatalog);

final List<StreamTransform> 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
Expand Down
Loading