-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Connector-builder server] Allow client to specify record limit and e…
…nforce max of 1000 (#20575)
- Loading branch information
Showing
8 changed files
with
297 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
airbyte-connector-builder-server/connector_builder/impl/adapter.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# | ||
# Copyright (c) 2022 Airbyte, Inc., all rights reserved. | ||
# | ||
|
||
from abc import ABC, abstractmethod | ||
from typing import Any, Dict, Iterator, List | ||
|
||
from airbyte_cdk.models import AirbyteMessage | ||
from airbyte_cdk.sources.streams.http import HttpStream | ||
|
||
|
||
class CdkAdapter(ABC): | ||
""" | ||
Abstract base class for the connector builder's CDK adapter. | ||
""" | ||
|
||
@abstractmethod | ||
def get_http_streams(self, config: Dict[str, Any]) -> List[HttpStream]: | ||
""" | ||
Gets a list of HTTP streams. | ||
:param config: The user-provided configuration as specified by the source's spec. | ||
:return: A list of `HttpStream`s. | ||
""" | ||
|
||
@abstractmethod | ||
def read_stream(self, stream: str, config: Dict[str, Any]) -> Iterator[AirbyteMessage]: | ||
""" | ||
Reads data from the specified stream. | ||
:param stream: stream | ||
:param config: The user-provided configuration as specified by the source's spec. | ||
:return: An iterator over `AirbyteMessage` objects. | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.