Skip to content

Commit

Permalink
fix default protocol version behavior for devs
Browse files Browse the repository at this point in the history
  • Loading branch information
cgardens committed Nov 29, 2022
1 parent 8a645d3 commit 09f8aae
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,8 @@ private Stream<StandardSourceDefinition> sourceDefQuery(final Optional<UUID> sou
.and(includeTombstone ? noCondition() : ACTOR_DEFINITION.TOMBSTONE.notEqual(true))
.fetchStream())
.map(DbConverter::buildStandardSourceDefinition)
// todo(cgardens) - the impls for default protocol version were different in list and get, which is
// right? used list.
.map(sourceDef -> sourceDef.withProtocolVersion(
AirbyteProtocolVersion.getWithDefault(sourceDef.getSpec() != null ? sourceDef.getSpec().getProtocolVersion() : null).serialize()));
// Ensure version is set. Needed for connectors not upgraded since we added versioning.
.map(def -> def.withProtocolVersion(AirbyteProtocolVersion.getWithDefault(def.getProtocolVersion()).serialize()));
}

public Map<UUID, Map.Entry<io.airbyte.config.ActorType, Version>> getActorDefinitionToProtocolVersionMap() throws IOException {
Expand Down Expand Up @@ -355,10 +353,8 @@ private Stream<StandardDestinationDefinition> destDefQuery(final Optional<UUID>
.and(includeTombstone ? noCondition() : ACTOR_DEFINITION.TOMBSTONE.notEqual(true))
.fetchStream())
.map(DbConverter::buildStandardDestinationDefinition)
// todo(cgardens) - the impls for default protocol version were different in list and get, which is
// right? used list.
.map(destDef -> destDef.withProtocolVersion(
AirbyteProtocolVersion.getWithDefault(destDef.getSpec() != null ? destDef.getSpec().getProtocolVersion() : null).serialize()));
// Ensure version is set. Needed for connectors not upgraded since we added versioning.
.map(def -> def.withProtocolVersion(AirbyteProtocolVersion.getWithDefault(def.getProtocolVersion()).serialize()));
}

public StandardDestinationDefinition getStandardDestinationDefinition(final UUID destinationDefinitionId)
Expand Down

0 comments on commit 09f8aae

Please sign in to comment.