You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This will generate a project with a type and a name of your choice and put it in
40
-
`airbyte-integrations/connectors`. Open the directory with your connector in an editor and follow
41
-
the `TODO` items.
14
+
For more information on building connectors, please see the [Connector Development](https://docs.airbyte.com/connector-development/) guide on [docs.airbyte.com](https://docs.airbyte.com).
42
15
43
16
## Python CDK Overview
44
17
45
18
Airbyte CDK code is within `airbyte_cdk` directory. Here's a high level overview of what's inside:
46
19
47
-
-`connector_builder`. Internal wrapper that helps the Connector Builder platform run a declarative
48
-
manifest (low-code connector). You should not use this code directly. If you need to run a
-`destinations`. Basic Destination connector support! If you're building a Destination connector in
53
-
Python, try that. Some of our vector DB destinations like `destination-pinecone` are using that
54
-
code.
55
-
-`models` expose `airbyte_protocol.models` as a part of `airbyte_cdk` package.
56
-
-`sources/concurrent_source` is the Concurrent CDK implementation. It supports reading data from
57
-
streams concurrently per slice / partition, useful for connectors with high throughput and high
58
-
number of records.
59
-
-`sources/declarative` is the low-code CDK. It works on top of Airbyte Python CDK, but provides a
60
-
declarative manifest language to define streams, operations, etc. This makes it easier to build
61
-
connectors without writing Python code.
62
-
-`sources/file_based` is the CDK for file-based sources. Examples include S3, Azure, GCS, etc.
20
+
-`airbyte_cdk/connector_builder`. Internal wrapper that helps the Connector Builder platform run a declarative manifest (low-code connector). You should not use this code directly. If you need to run a `SourceDeclarativeManifest`, take a look at [`source-declarative-manifest`](https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-declarative-manifest) connector implementation instead.
21
+
-`airbyte_cdk/cli/source_declarative_manifest`. This module defines the `source-declarative-manifest` (aka "SDM") connector execution logic and associated CLI.
22
+
-`airbyte_cdk/destinations`. Basic Destination connector support! If you're building a Destination connector in Python, try that. Some of our vector DB destinations like `destination-pinecone` are using that code.
23
+
-`airbyte_cdk/models` expose `airbyte_protocol.models` as a part of `airbyte_cdk` package.
24
+
-`airbyte_cdk/sources/concurrent_source` is the Concurrent CDK implementation. It supports reading data from streams concurrently per slice / partition, useful for connectors with high throughput and high number of records.
25
+
-`airbyte_cdk/sources/declarative` is the low-code CDK. It works on top of Airbyte Python CDK, but provides a declarative manifest language to define streams, operations, etc. This makes it easier to build connectors without writing Python code.
26
+
-`airbyte_cdk/sources/file_based` is the CDK for file-based sources. Examples include S3, Azure, GCS, etc.
63
27
64
28
## Contributing
65
29
66
-
Thank you for being interested in contributing to Airbyte Python CDK! Here are some guidelines to
67
-
get you started:
68
-
69
-
- We adhere to the [code of conduct](/CODE_OF_CONDUCT.md).
70
-
- You can contribute by reporting bugs, posting github discussions, opening issues, improving
71
-
[documentation](/docs/), and submitting pull requests with bugfixes and new features alike.
72
-
- If you're changing the code, please add unit tests for your change.
73
-
- When submitting issues or PRs, please add a small reproduction project. Using the changes in your
74
-
connector and providing that connector code as an example (or a satellite PR) helps!
75
-
76
-
### First time setup
77
-
78
-
Install the project dependencies and development tools:
79
-
80
-
```bash
81
-
poetry install --all-extras
82
-
```
83
-
84
-
Installing all extras is required to run the full suite of unit tests.
85
-
86
-
#### Running tests locally
87
-
88
-
- Iterate on the CDK code locally
89
-
- Run tests via `poetry run poe unit-test-with-cov`, or `python -m pytest -s unit_tests` if you want
90
-
to pass pytest options.
91
-
- Run `poetry run poe check-local` to lint all code, type-check modified code, and run unit tests
92
-
with coverage in one command.
93
-
94
-
To see all available scripts, run `poetry run poe`.
95
-
96
-
#### Formatting the code
97
-
98
-
- Iterate on the CDK code locally
99
-
- Run `poetry run ruff format` to format your changes.
100
-
101
-
To see all available `ruff` options, run `poetry run ruff`.
102
-
103
-
##### Autogenerated files
104
-
105
-
Low-code CDK models are generated from `sources/declarative/declarative_component_schema.yaml`. If
106
-
the iteration you are working on includes changes to the models or the connector generator, you
107
-
might want to regenerate them. In order to do that, you can run:
108
-
109
-
```bash
110
-
poetry run poe build
111
-
```
112
-
113
-
This will generate the code generator docker image and the component manifest files based on the
114
-
schemas and templates.
115
-
116
-
#### Testing
117
-
118
-
All tests are located in the `unit_tests` directory. Run `poetry run poe unit-test-with-cov` to run
119
-
them. This also presents a test coverage report. For faster iteration with no coverage report and
120
-
more options, `python -m pytest -s unit_tests` is a good place to start.
121
-
122
-
#### Building and testing a connector with your local CDK
123
-
124
-
When developing a new feature in the CDK, you may find it helpful to run a connector that uses that
125
-
new feature. You can test this in one of two ways:
126
-
127
-
- Running a connector locally
128
-
- Building and running a source via Docker
129
-
130
-
##### Installing your local CDK into a local Python connector
131
-
132
-
Open the connector's `pyproject.toml` file and replace the line with `airbyte_cdk` with the
0 commit comments