Skip to content

Commit a15e88c

Browse files
Update CDK & pytest versions for Vector DB destinations (#37333)
1 parent bae6304 commit a15e88c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+13757
-2512
lines changed

airbyte-integrations/connectors/destination-astra/README.md

+10-26
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,11 @@ For information about how to use this connector within Airbyte, see [the documen
1010

1111
#### Minimum Python version required `= 3.9.0`
1212

13-
#### Activate Virtual Environment and install dependencies
14-
From this connector directory, create a virtual environment:
15-
```
16-
python -m venv .venv
17-
```
18-
19-
This will generate a virtualenv for this module in `.venv/`. Make sure this venv is active in your
20-
development environment of choice. To activate it from the terminal, run:
21-
```
22-
source .venv/bin/activate
23-
pip install -r requirements.txt
13+
### Installing the connector
14+
From this connector directory, run:
15+
```bash
16+
poetry install --with dev
2417
```
25-
If you are in an IDE, follow your IDE's instructions to activate the virtualenv.
26-
27-
Note that while we are installing dependencies from `requirements.txt`, you should only edit `setup.py` for your dependencies. `requirements.txt` is
28-
used for editable installs (`pip install -e`) to pull in Python dependencies from the monorepo and will call `setup.py`.
29-
If this is mumbo jumbo to you, don't worry about it, just put your deps in `setup.py` but install using `pip install -r requirements.txt` and everything
30-
should work as you expect.
3118

3219

3320
#### Create credentials
@@ -43,8 +30,7 @@ and place them into `secrets/config.json`.
4330
```
4431
python main.py spec
4532
python main.py check --config secrets/config.json
46-
python main.py discover --config secrets/config.json
47-
python main.py read --config secrets/config.json --catalog integration_tests/configured_catalog.json
33+
python main.py write --config secrets/config.json --catalog integration_tests/configured_catalog.json
4834
```
4935

5036
### Locally running the connector docker image
@@ -118,25 +104,23 @@ docker run --rm airbyte/destination-astra:dev spec
118104
docker run --rm -v $(pwd)/secrets:/secrets airbyte/destination-astra:dev check --config /secrets/config.json
119105
# messages.jsonl is a file containing line-separated JSON representing AirbyteMessages
120106
cat messages.jsonl | docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/destination-astra:dev write --config /secrets/config.json --catalog /integration_tests/configured_catalog.json
121-
```
107+
108+
122109
## Testing
123110
Make sure to familiarize yourself with [pytest test discovery](https://docs.pytest.org/en/latest/goodpractices.html#test-discovery) to know how your test files and methods should be named.
124-
First install test dependencies into your virtual environment:
125-
```
126-
pip install .[tests]
127-
```
111+
128112
### Unit Tests
129113
To run unit tests locally, from the connector directory run:
130114
```
131-
python -m pytest unit_tests
115+
poetry run pytest -s unit_tests
132116
```
133117

134118
### Integration Tests
135119
There are two types of integration tests: Acceptance Tests (Airbyte's test suite for all destination connectors) and custom integration tests (which are specific to this connector).
136120
#### Custom Integration tests
137121
Place custom tests inside `integration_tests/` folder, then, from the connector root, run
138122
```
139-
python -m pytest integration_tests
123+
poetry run pytest -s integration_tests
140124
```
141125
#### Acceptance Tests
142126
Coming soon:

airbyte-integrations/connectors/destination-astra/metadata.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ data:
1515
connectorSubtype: database
1616
connectorType: destination
1717
definitionId: 042ce96f-1158-4662-9543-e2ff015be97a
18-
dockerImageTag: 0.1.1
18+
dockerImageTag: 0.1.2
1919
dockerRepository: airbyte/destination-astra
2020
githubIssueLabel: destination-astra
2121
icon: astra.svg

airbyte-integrations/connectors/destination-astra/poetry.lock

+2,923
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
[build-system]
2+
requires = [ "poetry-core>=1.0.0",]
3+
build-backend = "poetry.core.masonry.api"
4+
5+
[tool.poetry]
6+
name = "airbyte-destination-astra"
7+
version = "0.1.2"
8+
description = "Airbyte destination implementation for Astra DB."
9+
authors = ["Airbyte <[email protected]>"]
10+
license = "MIT"
11+
readme = "README.md"
12+
documentation = "https://docs.airbyte.com/integrations/destinations/astra"
13+
homepage = "https://airbyte.com"
14+
repository = "https://github.com/airbytehq/airbyte"
15+
16+
[[tool.poetry.packages]]
17+
include = "destination_astra"
18+
19+
[tool.poetry.dependencies]
20+
python = "^3.9,<3.12"
21+
airbyte-cdk = {version = "0.81.6", extras = ["vector-db-based"]}
22+
23+
[tool.poetry.group.dev.dependencies]
24+
pytest = "^7.2"
25+
ruff = "^0.3.2"
26+
mypy = "^1.9.0"
27+
28+
[tool.poetry.scripts]
29+
destination-astra = "destination_astra.run:run"

airbyte-integrations/connectors/destination-astra/requirements.txt

-1
This file was deleted.

airbyte-integrations/connectors/destination-astra/setup.py

-23
This file was deleted.

airbyte-integrations/connectors/destination-chroma/.dockerignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
!Dockerfile
33
!main.py
44
!destination_chroma
5-
!setup.py
5+
!pyproject.toml
6+
!poetry.lock

airbyte-integrations/connectors/destination-chroma/Dockerfile

-45
This file was deleted.

airbyte-integrations/connectors/destination-chroma/README.md

+17-19
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,11 @@ For information about how to use this connector within Airbyte, see [the documen
1010

1111
#### Minimum Python version required `= 3.7.0`
1212

13-
#### Build & Activate Virtual Environment and install dependencies
14-
From this connector directory, create a virtual environment:
15-
```
16-
python -m venv .venv
17-
```
18-
19-
This will generate a virtualenv for this module in `.venv/`. Make sure this venv is active in your
20-
development environment of choice. To activate it from the terminal, run:
21-
```
22-
source .venv/bin/activate
23-
pip install -r requirements.txt
13+
### Installing the connector
14+
From this connector directory, run:
15+
```bash
16+
poetry install --with dev
2417
```
25-
If you are in an IDE, follow your IDE's instructions to activate the virtualenv.
26-
27-
Note that while we are installing dependencies from `requirements.txt`, you should only edit `setup.py` for your dependencies. `requirements.txt` is
28-
used for editable installs (`pip install -e`) to pull in Python dependencies from the monorepo and will call `setup.py`.
29-
If this is mumbo jumbo to you, don't worry about it, just put your deps in `setup.py` but install using `pip install -r requirements.txt` and everything
30-
should work as you expect.
3118

3219
#### Create credentials
3320
**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.com/integrations/destinations/chroma)
@@ -42,8 +29,7 @@ and place them into `secrets/config.json`.
4229
```
4330
python main.py spec
4431
python main.py check --config secrets/config.json
45-
python main.py discover --config secrets/config.json
46-
python main.py read --config secrets/config.json --catalog integration_tests/configured_catalog.json
32+
python main.py write --config secrets/config.json --catalog integration_tests/configured_catalog.json
4733
```
4834

4935
### Locally running the connector docker image
@@ -77,6 +63,18 @@ You can run our full test suite locally using [`airbyte-ci`](https://github.com/
7763
airbyte-ci connectors --name=destination-chroma test
7864
```
7965

66+
### Unit Tests
67+
To run unit tests locally, from the connector directory run:
68+
```
69+
poetry run pytest -s unit_tests
70+
```
71+
72+
### Integration Tests
73+
To run integration tests locally, make sure you have a secrets/config.json as explained above, and then run:
74+
```
75+
poetry run pytest -s integration_tests
76+
```
77+
8078
### Customizing acceptance Tests
8179
Customize `acceptance-test-config.yml` file to configure tests. See [Connector Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/connector-acceptance-tests-reference) for more information.
8280
If your connector requires to create or destroy resources for use during acceptance tests create fixtures for it and place them inside integration_tests/acceptance.py.

airbyte-integrations/connectors/destination-chroma/metadata.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ data:
44
enabled: true
55
cloud:
66
enabled: false
7+
connectorBuildOptions:
8+
baseImage: docker.io/airbyte/python-connector-base:1.1.0@sha256:bd98f6505c6764b1b5f99d3aedc23dfc9e9af631a62533f60eb32b1d3dbab20c
79
connectorSubtype: vectorstore
810
connectorType: destination
911
definitionId: 0b75218b-f702-4a28-85ac-34d3d84c0fc2
10-
dockerImageTag: 0.0.9
12+
dockerImageTag: 0.0.10
1113
dockerRepository: airbyte/destination-chroma
1214
githubIssueLabel: destination-chroma
1315
icon: chroma.svg

0 commit comments

Comments
 (0)