-
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.
✨ Source PokeApi - Migrated to Low code (#30969)
Co-authored-by: Sajarin <[email protected]> Co-authored-by: marcosmarxm <[email protected]> Co-authored-by: Marcos Marx <[email protected]>
- Loading branch information
1 parent
79080c8
commit fdf5c97
Showing
26 changed files
with
1,145 additions
and
1,139 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,38 @@ | ||
FROM python:3.9-slim | ||
FROM python:3.9.11-alpine3.15 as base | ||
|
||
# Bash is installed for more convenient debugging. | ||
RUN apt-get update && apt-get install -y bash && rm -rf /var/lib/apt/lists/* | ||
# build and load all requirements | ||
FROM base as builder | ||
WORKDIR /airbyte/integration_code | ||
|
||
# upgrade pip to the latest version | ||
RUN apk --no-cache upgrade \ | ||
&& pip install --upgrade pip \ | ||
&& apk --no-cache add tzdata build-base | ||
|
||
|
||
COPY setup.py ./ | ||
# install necessary packages to a temporary folder | ||
RUN pip install --prefix=/install . | ||
|
||
# build a clean environment | ||
FROM base | ||
WORKDIR /airbyte/integration_code | ||
COPY source_pokeapi ./source_pokeapi | ||
|
||
# copy all loaded and built libraries to a pure basic image | ||
COPY --from=builder /install /usr/local | ||
# add default timezone settings | ||
COPY --from=builder /usr/share/zoneinfo/Etc/UTC /etc/localtime | ||
RUN echo "Etc/UTC" > /etc/timezone | ||
|
||
# bash is installed for more convenient debugging. | ||
RUN apk --no-cache add bash | ||
|
||
# copy payload code only | ||
COPY main.py ./ | ||
COPY setup.py ./ | ||
RUN pip install . | ||
COPY source_pokeapi ./source_pokeapi | ||
|
||
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py" | ||
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"] | ||
|
||
LABEL io.airbyte.version=0.1.5 | ||
LABEL io.airbyte.version=0.2.0 | ||
LABEL io.airbyte.name=airbyte/source-pokeapi |
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
4 changes: 0 additions & 4 deletions
4
...rs/source-pokeapi/unit_tests/unit_test.py → ...ons/connectors/source-pokeapi/__init__.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 |
---|---|---|
@@ -1,7 +1,3 @@ | ||
# | ||
# Copyright (c) 2023 Airbyte, Inc., all rights reserved. | ||
# | ||
|
||
|
||
def test_example_method(): | ||
assert True |
26 changes: 16 additions & 10 deletions
26
airbyte-integrations/connectors/source-pokeapi/acceptance-test-config.yml
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 |
---|---|---|
@@ -1,23 +1,29 @@ | ||
# See [Connector Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/connector-acceptance-tests-reference) | ||
# for more information about how to configure these tests | ||
connector_image: airbyte/source-pokeapi:dev | ||
test_strictness_level: high | ||
acceptance_tests: | ||
spec: | ||
bypass_reason: "The spec is currently invalid: it has additionalProperties set to false" | ||
tests: | ||
- spec_path: "source_pokeapi/spec.yaml" | ||
backward_compatibility_tests_config: | ||
disable_for_version: "0.1.5" | ||
connection: | ||
tests: | ||
- config_path: "integration_tests/config.json" | ||
- config_path: "secrets/config.json" | ||
status: "succeed" | ||
discovery: | ||
tests: | ||
- config_path: "integration_tests/config.json" | ||
- config_path: "secrets/config.json" | ||
backward_compatibility_tests_config: | ||
disable_for_version: "0.1.5" | ||
basic_read: | ||
tests: | ||
- config_path: "integration_tests/config.json" | ||
expect_records: | ||
bypass_reason: "We should create an expected_records file" | ||
- config_path: "secrets/config.json" | ||
configured_catalog_path: "integration_tests/configured_catalog.json" | ||
empty_streams: [] | ||
incremental: | ||
bypass_reason: "This connector does not implement incremental sync" | ||
full_refresh: | ||
tests: | ||
- config_path: "integration_tests/config.json" | ||
- config_path: "secrets/config.json" | ||
configured_catalog_path: "integration_tests/configured_catalog.json" | ||
incremental: | ||
bypass_reason: "This connector does not support incremental syncs." |
1 change: 1 addition & 0 deletions
1
airbyte-integrations/connectors/source-pokeapi/acceptance-test-docker.sh
100644 → 100755
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
#!/usr/bin/env sh | ||
|
||
source "$(git rev-parse --show-toplevel)/airbyte-integrations/bases/connector-acceptance-test/acceptance-test-docker.sh" |
2 changes: 1 addition & 1 deletion
2
airbyte-integrations/connectors/source-pokeapi/integration_tests/__init__.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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# | ||
# Copyright (c) 2021 Airbyte, Inc., all rights reserved. | ||
# Copyright (c) 2023 Airbyte, Inc., all rights reserved. | ||
# |
5 changes: 5 additions & 0 deletions
5
airbyte-integrations/connectors/source-pokeapi/integration_tests/abnormal_state.json
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,5 @@ | ||
{ | ||
"todo-stream-name": { | ||
"todo-field-name": "todo-abnormal-value" | ||
} | ||
} |
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
1 change: 0 additions & 1 deletion
1
airbyte-integrations/connectors/source-pokeapi/integration_tests/config.json
This file was deleted.
Oops, something went wrong.
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
4 changes: 3 additions & 1 deletion
4
airbyte-integrations/connectors/source-pokeapi/integration_tests/invalid_config.json
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 |
---|---|---|
@@ -1 +1,3 @@ | ||
{ "name": "datto" } | ||
{ | ||
"name": "datto" | ||
} |
3 changes: 3 additions & 0 deletions
3
airbyte-integrations/connectors/source-pokeapi/integration_tests/sample_config.json
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,3 @@ | ||
{ | ||
"pokemon_name": "ditto" | ||
} |
5 changes: 5 additions & 0 deletions
5
airbyte-integrations/connectors/source-pokeapi/integration_tests/sample_state.json
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,5 @@ | ||
{ | ||
"todo-stream-name": { | ||
"todo-field-name": "value" | ||
} | ||
} |
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
25 changes: 13 additions & 12 deletions
25
airbyte-integrations/connectors/source-pokeapi/metadata.yaml
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 |
---|---|---|
@@ -1,24 +1,25 @@ | ||
data: | ||
allowedHosts: | ||
hosts: | ||
- "*" | ||
registries: | ||
oss: | ||
enabled: true | ||
cloud: | ||
enabled: true | ||
connectorSubtype: api | ||
connectorType: source | ||
definitionId: 6371b14b-bc68-4236-bfbd-468e8df8e968 | ||
dockerImageTag: 0.1.5 | ||
dockerImageTag: 0.2.0 | ||
dockerRepository: airbyte/source-pokeapi | ||
githubIssueLabel: source-pokeapi | ||
icon: pokeapi.svg | ||
license: MIT | ||
name: PokeAPI | ||
registries: | ||
cloud: | ||
enabled: true | ||
oss: | ||
enabled: true | ||
name: Pokeapi | ||
releaseDate: '2020-05-04' | ||
releaseStage: alpha | ||
supportLevel: community | ||
documentationUrl: https://docs.airbyte.com/integrations/sources/pokeapi | ||
tags: | ||
- language:python | ||
ab_internal: | ||
sl: 100 | ||
ql: 100 | ||
supportLevel: community | ||
- language:lowcode | ||
metadataSpecVersion: "1.0" |
1 change: 1 addition & 0 deletions
1
airbyte-integrations/connectors/source-pokeapi/requirements.txt
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
-e . | ||
-e ../../bases/connector-acceptance-test |
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 |
---|---|---|
|
@@ -5,9 +5,15 @@ | |
|
||
from setuptools import find_packages, setup | ||
|
||
MAIN_REQUIREMENTS = ["airbyte-cdk~=0.1"] | ||
MAIN_REQUIREMENTS = [ | ||
"airbyte-cdk", | ||
] | ||
|
||
TEST_REQUIREMENTS = ["requests-mock~=1.9.3", "pytest-mock~=3.6.1", "pytest~=6.1"] | ||
TEST_REQUIREMENTS = [ | ||
"requests-mock~=1.9.3", | ||
"pytest~=6.2", | ||
"pytest-mock~=3.6.1", | ||
] | ||
|
||
setup( | ||
name="source_pokeapi", | ||
|
@@ -16,7 +22,7 @@ | |
author_email="[email protected]", | ||
packages=find_packages(), | ||
install_requires=MAIN_REQUIREMENTS, | ||
package_data={"": ["*.json", "schemas/*.json", "schemas/shared/*.json"]}, | ||
package_data={"": ["*.json", "*.yaml", "schemas/*.json", "schemas/shared/*.json"]}, | ||
extras_require={ | ||
"tests": TEST_REQUIREMENTS, | ||
}, | ||
|
3 changes: 2 additions & 1 deletion
3
airbyte-integrations/connectors/source-pokeapi/source_pokeapi/__init__.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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
# | ||
# Copyright (c) 2021 Airbyte, Inc., all rights reserved. | ||
# Copyright (c) 2023 Airbyte, Inc., all rights reserved. | ||
# | ||
|
||
|
||
from .source import SourcePokeapi | ||
|
||
__all__ = ["SourcePokeapi"] |
Oops, something went wrong.