-
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 DuckDB: ✨ Add MotherDuck support 🦆🦆 (#29428)
Co-authored-by: Elena Felder <[email protected]>
- Loading branch information
1 parent
5c56ac1
commit 68380cb
Showing
23 changed files
with
1,492 additions
and
149 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 |
---|---|---|
@@ -0,0 +1,76 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/python | ||
{ | ||
"name": "DuckDB Destination Connector DevContainer (Python)", | ||
|
||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||
"image": "mcr.microsoft.com/devcontainers/python:0-3.9", | ||
|
||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
"features": { | ||
"ghcr.io/devcontainers-contrib/features/poetry:2": {}, | ||
"ghcr.io/devcontainers/features/docker-in-docker": {} | ||
}, | ||
"overrideFeatureInstallOrder": [ | ||
// Deterministic order maximizes cache reuse | ||
"ghcr.io/devcontainers-contrib/features/poetry", | ||
"ghcr.io/devcontainers/features/docker-in-docker" | ||
], | ||
|
||
"workspaceFolder": "/workspaces/airbyte/airbyte-integrations/connectors/destination-duckdb", | ||
|
||
// Configure tool-specific properties. | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
// Python extensions: | ||
"charliermarsh.ruff", | ||
"matangover.mypy", | ||
"ms-python.black", | ||
"ms-python.python", | ||
"ms-python.vscode-pylance", | ||
|
||
// Toml support | ||
"tamasfe.even-better-toml", | ||
|
||
// Yaml and JSON Schema support: | ||
"redhat.vscode-yaml", | ||
|
||
// Contributing: | ||
"GitHub.vscode-pull-request-github" | ||
], | ||
"settings": { | ||
"extensions.ignoreRecommendations": true, | ||
"git.openRepositoryInParentFolders": "always", | ||
"python.defaultInterpreterPath": ".venv/bin/python", | ||
"python.interpreter.infoVisibility": "always", | ||
"python.terminal.activateEnvironment": true, | ||
"python.testing.pytestEnabled": true, | ||
"python.testing.cwd": "/workspaces/airbyte/airbyte-integrations/connectors/destination-duckdb", | ||
"python.testing.pytestArgs": [ | ||
"--rootdir=/workspaces/airbyte/airbyte-integrations/connectors/destination-duckdb", | ||
"." | ||
] | ||
} | ||
} | ||
}, | ||
"containerEnv": { | ||
"POETRY_VIRTUALENVS_IN_PROJECT": "true" | ||
}, | ||
|
||
// Mark the root directory as 'safe' for git. | ||
"initializeCommand": "git config --add safe.directory /workspaces/airbyte", | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// Post-create tasks: | ||
// 1. Create a symlink directory. | ||
// 2. Create symlinks for the devcontainer.json and docs markdown file. | ||
// 3. Install the Python/Poetry dependencies. | ||
"postCreateCommand": "mkdir -p ./.symlinks && echo '*' > ./.symlinks/.gitignore && ln -sf /workspaces/airbyte/.devcontainer/destination-duckdb/devcontainer.json ./.symlinks/devcontainer.json && ln -sf /workspaces/airbyte/docs/integrations/destinations/duckdb.md ./.symlinks/duckdb-docs.md && poetry install" | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
|
||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "root" | ||
} |
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
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" | |
|
||
[tool.poetry] | ||
name = "connector_ops" | ||
version = "0.2.2" | ||
version = "0.2.3" | ||
description = "Packaged maintained by the connector operations team to perform CI for connectors" | ||
authors = ["Airbyte <[email protected]>"] | ||
|
||
|
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
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
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" | |
|
||
[tool.poetry] | ||
name = "pipelines" | ||
version = "1.3.0" | ||
version = "1.4.0" | ||
description = "Packaged maintained by the connector operations team to perform CI for connectors' pipelines" | ||
authors = ["Airbyte <[email protected]>"] | ||
|
||
|
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
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 |
---|---|---|
|
@@ -3,3 +3,6 @@ | |
!main.py | ||
!destination_duckdb | ||
!setup.py | ||
!pyproject.toml | ||
!poetry.lock | ||
!README.md |
2 changes: 2 additions & 0 deletions
2
airbyte-integrations/connectors/destination-duckdb/.gitignore
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,2 @@ | ||
# Ignore symlinks created within the dev container | ||
.symlinks |
38 changes: 15 additions & 23 deletions
38
airbyte-integrations/connectors/destination-duckdb/Dockerfile
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,42 +1,34 @@ | ||
FROM python:3.9.11 as base | ||
FROM python:3.9.11 | ||
# FROM python:3.9.11-alpine3.15 as base | ||
# switched from alpine as there were tons of errors (in case you want to switch back to alpine) | ||
# - https://stackoverflow.com/a/57485724/5246670 | ||
# - numpy error: https://stackoverflow.com/a/22411624/5246670 | ||
# - libstdc++ https://github.com/amancevice/docker-pandas/issues/12#issuecomment-717215043 | ||
# - musl-dev linux-headers g++ because of: https://stackoverflow.com/a/40407099/5246670 | ||
|
||
# build and load all requirements | ||
FROM base as builder | ||
WORKDIR /airbyte/integration_code | ||
|
||
# upgrade pip to the latest version | ||
# Upgrade system packages and install Poetry | ||
RUN apt-get update && apt-get -y upgrade \ | ||
&& pip install --upgrade pip | ||
&& pip install --upgrade pip \ | ||
&& pip install poetry | ||
|
||
COPY setup.py ./ | ||
# install necessary packages to a temporary folder | ||
RUN pip install --prefix=/install . | ||
# build a clean environment | ||
FROM base | ||
# RUN conda install -c conda-forge python-duckdb | ||
WORKDIR /airbyte/integration_code | ||
|
||
# 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 | ||
# Copy only poetry.lock* in case it doesn't exist | ||
COPY pyproject.toml poetry.lock* ./ | ||
RUN poetry config virtualenvs.create false \ | ||
&& poetry install --no-root --no-dev | ||
|
||
#adding duckdb manually (outside of setup.py - lots of errors) | ||
RUN pip install duckdb | ||
|
||
# copy payload code only | ||
# Copy code | ||
COPY main.py ./ | ||
COPY destination_duckdb ./destination_duckdb | ||
|
||
# Timezone setup | ||
COPY --from=python:3.9.11 /usr/share/zoneinfo/Etc/UTC /etc/localtime | ||
RUN echo "Etc/UTC" > /etc/timezone | ||
|
||
# Entry point | ||
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py" | ||
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"] | ||
|
||
LABEL io.airbyte.version=0.1.0 | ||
LABEL io.airbyte.version=0.2.0 | ||
LABEL io.airbyte.name=airbyte/destination-duckdb |
10 changes: 10 additions & 0 deletions
10
airbyte-integrations/connectors/destination-duckdb/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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
connector_image: airbyte/destination-duckdb:dev | ||
acceptance_tests: | ||
spec: | ||
tests: | ||
- spec_path: integration_tests/spec.json | ||
config_path: "integration_tests/config.json" | ||
connection: | ||
tests: | ||
- config_path: "integration_tests/config.json" | ||
status: "succeed" |
8 changes: 0 additions & 8 deletions
8
airbyte-integrations/connectors/destination-duckdb/build.gradle
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.