Skip to content

Commit

Permalink
ref(source-amazon-ads): migrate to low code (#48116)
Browse files Browse the repository at this point in the history
Signed-off-by: Artem Inzhyyants <artem.inzhyyants@gmail.com>
  • Loading branch information
artem1205 authored Nov 20, 2024
1 parent e610db7 commit 696b979
Show file tree
Hide file tree
Showing 44 changed files with 2,208 additions and 2,387 deletions.
3 changes: 3 additions & 0 deletions airbyte-integrations/connectors/source-amazon-ads/.coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[run]
omit =
source_amazon_ads/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ data:
connectorSubtype: api
connectorType: source
definitionId: c6b0a29e-1da9-4512-9002-7bfd0cba2246
dockerImageTag: 6.1.4
dockerImageTag: 6.2.0
dockerRepository: airbyte/source-amazon-ads
documentationUrl: https://docs.airbyte.com/integrations/sources/amazon-ads
githubIssueLabel: source-amazon-ads
Expand Down
462 changes: 239 additions & 223 deletions airbyte-integrations/connectors/source-amazon-ads/poetry.lock

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = [ "poetry-core>=1.0.0",]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
version = "6.1.4"
version = "6.2.0"
name = "source-amazon-ads"
description = "Source implementation for Amazon Ads."
authors = [ "Airbyte <contact@airbyte.io>",]
Expand All @@ -17,7 +17,7 @@ include = "source_amazon_ads"

[tool.poetry.dependencies]
python = "^3.10,<3.12"
airbyte-cdk = "^5"
airbyte-cdk = "^6"

[tool.poetry.scripts]
source-amazon-ads = "source_amazon_ads.run:run"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import logging
from typing import Any, List, Mapping

from airbyte_cdk.config_observation import create_connector_config_control_message
from airbyte_cdk.config_observation import emit_configuration_as_airbyte_control_message
from airbyte_cdk.entrypoint import AirbyteEntrypoint
from airbyte_cdk.sources import Source
from airbyte_cdk.sources.message import InMemoryMessageRepository, MessageRepository
Expand Down Expand Up @@ -72,18 +72,6 @@ def modify_and_save(cls, config_path: str, source: Source, config: Mapping[str,
source.write_config(migrated_config, config_path)
return migrated_config

@classmethod
def emit_control_message(cls, migrated_config: Mapping[str, Any]) -> None:
"""
Emits the control messages related to configuration migration.
Args:
- migrated_config (Mapping[str, Any]): The migrated configuration.
"""
cls.message_repository.emit_message(create_connector_config_control_message(migrated_config))
for message in cls.message_repository._message_queue:
print(message.json(exclude_unset=True))

@classmethod
def migrate(cls, args: List[str], source: Source) -> None:
"""
Expand All @@ -101,4 +89,4 @@ def migrate(cls, args: List[str], source: Source) -> None:
if config_path:
config = source.read_config(config_path)
if cls.should_migrate(config):
cls.emit_control_message(cls.modify_and_save(config_path, source, config))
emit_configuration_as_airbyte_control_message(cls.modify_and_save(config_path, source, config))
Loading

0 comments on commit 696b979

Please sign in to comment.