From 53064662e34e8b918de683fa35cc8fcd65882d13 Mon Sep 17 00:00:00 2001 From: Joe Reuter Date: Tue, 16 Jan 2024 12:36:04 +0100 Subject: [PATCH] Source Mixpanel: Convert to airbyte-lib (#34147) Co-authored-by: Serhii Lazebnyi <53845333+lazebnyi@users.noreply.github.com> --- .../connectors/source-mixpanel/main.py | 11 ++--------- .../connectors/source-mixpanel/metadata.yaml | 2 +- .../connectors/source-mixpanel/setup.py | 5 +++++ .../source-mixpanel/source_mixpanel/run.py | 16 ++++++++++++++++ docs/integrations/sources/mixpanel.md | 1 + 5 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 airbyte-integrations/connectors/source-mixpanel/source_mixpanel/run.py diff --git a/airbyte-integrations/connectors/source-mixpanel/main.py b/airbyte-integrations/connectors/source-mixpanel/main.py index 5c1449d8dcf42..df8cb33fc826e 100644 --- a/airbyte-integrations/connectors/source-mixpanel/main.py +++ b/airbyte-integrations/connectors/source-mixpanel/main.py @@ -2,14 +2,7 @@ # Copyright (c) 2023 Airbyte, Inc., all rights reserved. # - -import sys - -from airbyte_cdk.entrypoint import launch -from source_mixpanel import SourceMixpanel -from source_mixpanel.config_migrations import MigrateProjectId +from source_mixpanel.run import run if __name__ == "__main__": - source = SourceMixpanel() - MigrateProjectId.migrate(sys.argv[1:], source) - launch(source, sys.argv[1:]) + run() diff --git a/airbyte-integrations/connectors/source-mixpanel/metadata.yaml b/airbyte-integrations/connectors/source-mixpanel/metadata.yaml index bceeb8d9eb005..e40a80cfc9053 100644 --- a/airbyte-integrations/connectors/source-mixpanel/metadata.yaml +++ b/airbyte-integrations/connectors/source-mixpanel/metadata.yaml @@ -11,7 +11,7 @@ data: connectorSubtype: api connectorType: source definitionId: 12928b32-bf0a-4f1e-964f-07e12e37153a - dockerImageTag: 2.0.0 + dockerImageTag: 2.0.1 dockerRepository: airbyte/source-mixpanel documentationUrl: https://docs.airbyte.com/integrations/sources/mixpanel githubIssueLabel: source-mixpanel diff --git a/airbyte-integrations/connectors/source-mixpanel/setup.py b/airbyte-integrations/connectors/source-mixpanel/setup.py index 4a9918b16c913..b89f8d01fbd7a 100644 --- a/airbyte-integrations/connectors/source-mixpanel/setup.py +++ b/airbyte-integrations/connectors/source-mixpanel/setup.py @@ -12,6 +12,11 @@ TEST_REQUIREMENTS = ["requests-mock~=1.9.3", "pytest~=6.1", "pytest-mock~=3.6", "requests_mock~=1.8"] setup( + entry_points={ + "console_scripts": [ + "source-mixpanel=source_mixpanel.run:run", + ], + }, name="source_mixpanel", description="Source implementation for Mixpanel.", author="Airbyte", diff --git a/airbyte-integrations/connectors/source-mixpanel/source_mixpanel/run.py b/airbyte-integrations/connectors/source-mixpanel/source_mixpanel/run.py new file mode 100644 index 0000000000000..1d512c472c849 --- /dev/null +++ b/airbyte-integrations/connectors/source-mixpanel/source_mixpanel/run.py @@ -0,0 +1,16 @@ +# +# Copyright (c) 2023 Airbyte, Inc., all rights reserved. +# + + +import sys + +from airbyte_cdk.entrypoint import launch +from source_mixpanel import SourceMixpanel +from source_mixpanel.config_migrations import MigrateProjectId + + +def run(): + source = SourceMixpanel() + MigrateProjectId.migrate(sys.argv[1:], source) + launch(source, sys.argv[1:]) diff --git a/docs/integrations/sources/mixpanel.md b/docs/integrations/sources/mixpanel.md index 5593a107647bb..b4cc8d6cfaae0 100644 --- a/docs/integrations/sources/mixpanel.md +++ b/docs/integrations/sources/mixpanel.md @@ -55,6 +55,7 @@ Syncing huge date windows may take longer due to Mixpanel's low API rate-limits | Version | Date | Pull Request | Subject | |:--------|:-----------|:---------------------------------------------------------|:------------------------------------------------------------------------------------------------------------| +| 2.0.1 | 2024-01-11 | [34147](https://github.com/airbytehq/airbyte/pull/34147) | prepare for airbyte-lib | | 2.0.0 | 2023-10-30 | [31955](https://github.com/airbytehq/airbyte/pull/31955) | Delete the default primary key for the Export stream | | 1.0.1 | 2023-10-19 | [31599](https://github.com/airbytehq/airbyte/pull/31599) | Base image migration: remove Dockerfile and use the python-connector-base image | | 1.0.0 | 2023-09-27 | [30025](https://github.com/airbytehq/airbyte/pull/30025) | Fix type of datetime field in engage stream; fix primary key for export stream. |