Skip to content

Commit

Permalink
Updates config_change_callback to only pass config
Browse files Browse the repository at this point in the history
  • Loading branch information
tcboles committed Nov 5, 2024
1 parent 41afdcb commit 2fbce7f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions airbyte/_connector_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def __init__(
executor: Executor,
name: str,
config: dict[str, Any] | None = None,
config_change_callback: Callable[[dict[str, Any], int], None] | None = None,
config_change_callback: Callable[[dict[str, Any]], None] | None = None,
*,
validate: bool = False,
) -> None:
Expand Down Expand Up @@ -388,7 +388,7 @@ def _peek_airbyte_message(
and message.control.type == "CONNECTOR_CONFIG"
and self.config_change_callback is not None
):
self.config_change_callback(message.control.config, message.control.emitted_at)
self.config_change_callback(message.control.config)
return

def _execute(
Expand Down
2 changes: 1 addition & 1 deletion airbyte/destinations/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def __init__(
executor: Executor,
name: str,
config: dict[str, Any] | None = None,
config_change_callback: Callable[[dict[str, Any], int], None] | None = None,
config_change_callback: Callable[[dict[str, Any]], None] | None = None,
*,
validate: bool = False,
) -> None:
Expand Down
2 changes: 1 addition & 1 deletion airbyte/destinations/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
def get_destination(
name: str,
config: dict[str, Any] | None = None,
config_change_callback: Callable[[dict[str, Any], int], None] | None = None,
config_change_callback: Callable[[dict[str, Any]], None] | None = None,
*,
version: str | None = None,
pip_url: str | None = None,
Expand Down
2 changes: 1 addition & 1 deletion airbyte/sources/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def __init__(
executor: Executor,
name: str,
config: dict[str, Any] | None = None,
config_change_callback: Callable[[dict[str, Any], int], None] | None = None,
config_change_callback: Callable[[dict[str, Any]], None] | None = None,
streams: str | list[str] | None = None,
*,
validate: bool = False,
Expand Down
3 changes: 2 additions & 1 deletion airbyte/sources/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def get_connector(
def get_source( # noqa: PLR0913 # Too many arguments
name: str,
config: dict[str, Any] | None = None,
config_change_callback: Callable[[dict[str, Any], int], None] | None = None,
config_change_callback: Callable[[dict[str, Any]], None] | None = None,
*,
streams: str | list[str] | None = None,
version: str | None = None,
Expand Down Expand Up @@ -74,6 +74,7 @@ def get_source( # noqa: PLR0913 # Too many arguments
name: connector name
config: connector config - if not provided, you need to set it later via the set_config
method.
config_change_callback: callback function to be called when the connector config changes.
streams: list of stream names to select for reading. If set to "*", all streams will be
selected. If not provided, you can set it later via the `select_streams()` or
`select_all_streams()` method.
Expand Down

0 comments on commit 2fbce7f

Please sign in to comment.