Skip to content

Commit 35a83cd

Browse files
committed
Merge branch 'lazebnyi/add-state-delegating-retriever' of github.com:airbytehq/airbyte-python-cdk into lazebnyi/add-state-delegating-retriever
2 parents 3481894 + 43a56ed commit 35a83cd

File tree

15 files changed

+142
-401
lines changed

15 files changed

+142
-401
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Docker Build Check
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
docker-build-check:
10+
name: SDM Docker Image Build # Renamed job to be more descriptive
11+
runs-on: ubuntu-24.04
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
18+
# Build the Python package to create the wheel files needed for the Docker build
19+
- name: Build Python Package
20+
uses: hynek/build-and-inspect-python-package@v2
21+
env:
22+
POETRY_DYNAMIC_VERSIONING_BYPASS: "0.0.0dev0"
23+
24+
# Copy the wheel files to the dist directory
25+
- name: Copy wheel files to dist directory
26+
run: |
27+
mkdir -p dist
28+
cp /tmp/baipp/dist/*.whl dist/
29+
30+
- name: Set up QEMU for multi-platform builds
31+
uses: docker/setup-qemu-action@v3
32+
33+
- name: Set up Docker Buildx
34+
uses: docker/setup-buildx-action@v3
35+
36+
- name: Build Docker image for multiple platforms
37+
id: docker-build
38+
uses: docker/build-push-action@v5
39+
with:
40+
context: .
41+
platforms: linux/amd64,linux/arm64
42+
push: false
43+
tags: airbyte/source-declarative-manifest:pr-${{ github.event.pull_request.number }}
44+
outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=SDM Docker image for PR ${{ github.event.pull_request.number }}

.github/workflows/semantic_pr_check.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,13 @@ jobs:
3939
Build
4040
tests
4141
Tests
42+
43+
- name: Check for "do not merge" in PR title
44+
if: ${{ github.event.pull_request.draft == false }}
45+
uses: actions/github-script@v6
46+
with:
47+
script: |
48+
const title = context.payload.pull_request.title.toLowerCase();
49+
if (title.includes('do not merge') || title.includes('do-not-merge')) {
50+
core.setFailed('PR title contains "do not merge" or "do-not-merge". Please remove this before merging.');
51+
}

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# A new version of source-declarative-manifest is built for every new Airbyte CDK release, and their versions are kept in sync.
66
#
77

8-
FROM docker.io/airbyte/python-connector-base:3.0.0@sha256:1a0845ff2b30eafa793c6eee4e8f4283c2e52e1bbd44eed6cb9e9abd5d34d844
8+
FROM docker.io/airbyte/python-connector-base:4.0.0@sha256:d9894b6895923b379f3006fa251147806919c62b7d9021b5cd125bb67d7bbe22
99

1010
WORKDIR /airbyte/integration_code
1111

@@ -24,8 +24,8 @@ RUN pip install dist/*.whl
2424
RUN mkdir -p source_declarative_manifest \
2525
&& echo 'from source_declarative_manifest.run import run\n\nif __name__ == "__main__":\n run()' > main.py \
2626
&& touch source_declarative_manifest/__init__.py \
27-
&& cp /usr/local/lib/python3.10/site-packages/airbyte_cdk/cli/source_declarative_manifest/_run.py source_declarative_manifest/run.py \
28-
&& cp /usr/local/lib/python3.10/site-packages/airbyte_cdk/cli/source_declarative_manifest/spec.json source_declarative_manifest/
27+
&& cp /usr/local/lib/python3.11/site-packages/airbyte_cdk/cli/source_declarative_manifest/_run.py source_declarative_manifest/run.py \
28+
&& cp /usr/local/lib/python3.11/site-packages/airbyte_cdk/cli/source_declarative_manifest/spec.json source_declarative_manifest/
2929

3030
# Remove unnecessary build files
3131
RUN rm -rf dist/ pyproject.toml poetry.lock README.md

airbyte_cdk/sources/declarative/concurrent_declarative_source.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,8 @@ def _group_streams(
220220
if (
221221
name_to_stream_mapping[declarative_stream.name]
222222
.get("retriever", {})
223-
.get("full_refresh_no_slice_in_params", False) and incremental_sync_component_definition
223+
.get("full_refresh_no_slice_in_params", False)
224+
and incremental_sync_component_definition
224225
):
225226
incremental_sync_component_definition["step"] = None
226227
incremental_sync_component_definition["cursor_granularity"] = None

airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1808,10 +1808,11 @@ def _build_incremental_cursor(
18081808
stream_slicer: Optional[PartitionRouter],
18091809
config: Config,
18101810
) -> Optional[StreamSlicer]:
1811-
18121811
if model.retriever.type == "StateDelegatingRetriever":
18131812
if not model.incremental_sync:
1814-
raise ValueError("StateDelegatingRetriever requires 'incremental_sync' to be enabled.")
1813+
raise ValueError(
1814+
"StateDelegatingRetriever requires 'incremental_sync' to be enabled."
1815+
)
18151816
elif model.incremental_sync.type != "DatetimeBasedCursor":
18161817
raise ValueError("StateDelegatingRetriever support only DatetimeBasedCursor.")
18171818
elif model.retriever.full_refresh_no_slice_in_params:

airbyte_cdk/sources/embedded/__init__.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

airbyte_cdk/sources/embedded/base_integration.py

Lines changed: 0 additions & 61 deletions
This file was deleted.

airbyte_cdk/sources/embedded/catalog.py

Lines changed: 0 additions & 57 deletions
This file was deleted.

airbyte_cdk/sources/embedded/runner.py

Lines changed: 0 additions & 57 deletions
This file was deleted.

airbyte_cdk/sources/embedded/tools.py

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)