Skip to content

Commit af0640c

Browse files
committed
Update protocol to have dev version objects
1 parent c6c8d8f commit af0640c

File tree

5 files changed

+254
-122
lines changed

5 files changed

+254
-122
lines changed

airbyte_cdk/destinations/destination.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
from airbyte_cdk.connector import Connector
1515
from airbyte_cdk.exception_handler import init_uncaught_exception_handler
1616
from airbyte_cdk.models import (
17-
AirbyteCatalog,
1817
AirbyteMessage,
1918
AirbyteMessageSerializer,
2019
ConfiguredAirbyteCatalog,
2120
ConfiguredAirbyteCatalogSerializer,
21+
DestinationCatalog,
2222
Type,
2323
)
2424
from airbyte_cdk.sources.utils.schema_helpers import check_config_against_spec_or_exit
@@ -92,7 +92,7 @@ def parse_args(args: List[str]) -> argparse.Namespace:
9292
class Destination(Connector, ABC):
9393
VALID_CMDS = {"spec", "check", "discover", "write"}
9494

95-
def discover(self) -> AirbyteCatalog:
95+
def discover(self) -> DestinationCatalog:
9696
"""Implement to define what objects are available in the destination"""
9797
raise NotImplementedError("Discover method is not implemented")
9898

@@ -162,7 +162,7 @@ def run_cmd(self, parsed_args: argparse.Namespace) -> Iterable[AirbyteMessage]:
162162
if cmd == "check":
163163
yield self._run_check(config=config)
164164
elif cmd == "discover":
165-
yield AirbyteMessage(type=Type.CATALOG, catalog=self.discover())
165+
yield AirbyteMessage(type=Type.DESTINATION_CATALOG, destination_catalog=self.discover())
166166
elif cmd == "write":
167167
# Wrap in UTF-8 to override any other input encodings
168168
wrapped_stdin = io.TextIOWrapper(sys.stdin.buffer, encoding="utf-8")

airbyte_cdk/models/__init__.py

+4
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
ConfiguredAirbyteCatalog,
3636
ConfiguredAirbyteStream,
3737
ConnectorSpecification,
38+
DestinationCatalog,
39+
DestinationObject,
40+
DestinationObjectProperty,
41+
DestinationOperation,
3842
DestinationSyncMode,
3943
EstimateType,
4044
FailureType,

airbyte_cdk/test/catalog_builder.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def with_stream(self, name: str, sync_mode: SyncMode) -> "CatalogBuilder": ...
6666
def with_stream(
6767
self,
6868
name: Union[str, ConfiguredAirbyteStreamBuilder],
69-
sync_mode: Union[SyncMode, None] = None,
69+
sync_mode: SyncMode = SyncMode.full_refresh,
7070
) -> "CatalogBuilder":
7171
# As we are introducing a fully fledge ConfiguredAirbyteStreamBuilder, we would like to deprecate the previous interface
7272
# with_stream(str, SyncMode)

0 commit comments

Comments
 (0)