Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source File Secure: Refactor to use the CDK #7450

Merged
merged 6 commits into from
Nov 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions airbyte-integrations/connectors/source-file-secure/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
FROM airbyte/source-file:0.2.6
FROM airbyte/source-file:0.2.7

WORKDIR /airbyte/integration_code

ENV CODE_PATH="source_file_secure"
ENV AIRBYTE_IMPL_MODULE="source_file_secure"
ENV AIRBYTE_IMPL_PATH="SourceFileSecure"

COPY $CODE_PATH ./$CODE_PATH
RUN sed -i 's/source_file/source_file_secure/g' setup.py
COPY source_file_secure ./source_file_secure
COPY main.py ./
COPY setup.py ./
RUN pip install .

ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]

LABEL io.airbyte.version=0.1.1
LABEL io.airbyte.name=airbyte/source-file-secure
LABEL io.airbyte.version=0.1.0
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# See [Source Acceptance Tests](https://docs.airbyte.io/connector-development/testing-connectors/source-acceptance-tests-reference)
# for more information about how to configure these tests

# Here we tries to test a basic tests only.
# Here we tries to test a basic tests only.
# The main part of tests should be executed for the source-file connector
connector_image: airbyte/source-file-secure:dev
tests:
Expand All @@ -11,19 +11,17 @@ tests:
- config_path: "integration_tests/invalid_config.json"
status: "failed"
# for https
- config_path: "integration_tests/https_config.json"
status: "succeed"
- config_path: "integration_tests/config.json"
status: "succeed"
# for local should be failed
- config_path: "integration_tests/local_config.json"
status: "exception"
status: "exception"

discovery:
# for https
- config_path: "integration_tests/https_config.json"
- config_path: "integration_tests/config.json"

basic_read:
# for https
- config_path: "integration_tests/https_config.json"
configured_catalog_path: "integration_tests/configured_https_catalog.json"


- config_path: "integration_tests/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,3 @@ plugins {
airbytePython {
moduleDirectory 'source_file_secure'
}

dependencies {
implementation files(project(':airbyte-integrations:bases:source-acceptance-test').airbyteDocker.outputs)
implementation files(project(':airbyte-integrations:bases:base-python').airbyteDocker.outputs)
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"reader_options": "{\"bla\": \",\", \"nrows\": 20}",
"url": "https://fake-fake.com",
"provider": {
"storage": "fake",
"storage": "HTTPS",
"reader_impl": "fake"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import sys

from base_python.entrypoint import launch
from airbyte_cdk.entrypoint import launch
from source_file_secure import SourceFileSecure

if __name__ == "__main__":
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# This file is autogenerated -- only edit if you know what you are doing. Use setup.py for declaring dependencies.
-e ../../bases/airbyte-protocol
-e ../../bases/base-python
-e ../../bases/source-acceptance-test
-e ../source-file
-e .
5 changes: 2 additions & 3 deletions airbyte-integrations/connectors/source-file-secure/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
from setuptools import find_packages, setup

MAIN_REQUIREMENTS = [
"airbyte-protocol",
"base-python",
"airbyte-cdk~=0.1",
"gcsfs==0.7.1",
"genson==1.2.2",
"google-cloud-storage==1.35.0",
Expand All @@ -31,7 +30,7 @@
]

setup(
name="source_file",
name="source_file_secure",
description="Source implementation for File",
author="Airbyte",
author_email="contact@airbyte.io",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
import os
import sys

from airbyte_protocol import ConnectorSpecification
from base_python.logger import AirbyteLogger

# some integration tests doesn't setup dependences from
# requirements.txt file and Python can return a exception.
# Thus we should to import this parent module manually
from airbyte_cdk import AirbyteLogger
from airbyte_cdk.models import ConnectorSpecification

try:
import source_file.source
except ModuleNotFoundError:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#

import pytest
from base_python.logger import AirbyteLogger
from airbyte_cdk import AirbyteLogger
from source_file_secure import SourceFileSecure
from source_file_secure.source import LOCAL_STORAGE_NAME

Expand Down