Skip to content

Commit f8aa728

Browse files
committed
ai overlord review suggestions
1 parent c6b1ffe commit f8aa728

File tree

5 files changed

+20
-19
lines changed

5 files changed

+20
-19
lines changed

airbyte_cdk/manifest_server/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ poetry install --extras manifest-server
1616
pip install airbyte-cdk[manifest-server]
1717

1818
# Using uv
19-
uv pip install 'airbyte-cdk[manifest-runner]'
19+
uv pip install 'airbyte-cdk[manifest-server]'
2020
```
2121

2222
### Running the Server
@@ -36,27 +36,27 @@ The server will start on `http://localhost:8000` by default.
3636

3737
## API Endpoints
3838

39-
### `/manifest/test_read`
39+
### `/v1/manifest/test_read`
4040
Test reading from a specific stream in the manifest.
4141

4242
**POST** - Test stream reading with configurable limits for records, pages, and slices.
4343

44-
### `/manifest/check`
44+
### `/v1/manifest/check`
4545
Check configuration against a manifest.
4646

4747
**POST** - Validates connector configuration and returns success/failure status with message.
4848

49-
### `/manifest/discover`
49+
### `/v1/manifest/discover`
5050
Discover streams from a manifest.
5151

5252
**POST** - Returns the catalog of available streams from the manifest.
5353

54-
### `/manifest/resolve`
54+
### `/v1/manifest/resolve`
5555
Resolve a manifest to its final configuration.
5656

5757
**POST** - Returns the resolved manifest without dynamic stream generation.
5858

59-
### `/manifest/full_resolve`
59+
### `/v1/manifest/full_resolve`
6060
Fully resolve a manifest including dynamic streams.
6161

6262
**POST** - Generates dynamic streams up to specified limits and includes them in the resolved manifest.
@@ -86,7 +86,7 @@ export AB_JWT_SIGNATURE_SECRET="your-jwt-secret-key"
8686
When authentication is enabled, include a valid JWT token in the Authorization header:
8787
```bash
8888
curl -H "Authorization: Bearer <your-jwt-token>" \
89-
http://localhost:8000/manifest/test_read
89+
http://localhost:8000/v1/manifest/test_read
9090
```
9191

9292
### Behavior

airbyte_cdk/manifest_server/api_models/manifest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class StreamTestReadRequest(BaseModel):
1919
manifest: Manifest
2020
config: ConnectorConfig
2121
stream_name: str
22-
state: List[Any] = []
22+
state: List[Any] = Field(default_factory=list)
2323
custom_components_code: Optional[str] = None
2424
record_limit: int = Field(default=100, ge=1, le=5000)
2525
page_limit: int = Field(default=5, ge=1, le=20)

airbyte_cdk/manifest_server/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from fastapi import FastAPI
22

3-
from ..manifest_server.routers import capabilities, health, manifest
3+
from .routers import capabilities, health, manifest
44

55
app = FastAPI(
66
title="Manifest Server",

airbyte_cdk/manifest_server/routers/manifest.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,28 +73,29 @@ def test_read(request: StreamTestReadRequest) -> StreamRead:
7373
config_dict = request.config.model_dump()
7474

7575
catalog = build_catalog(request.stream_name)
76+
converted_state = [AirbyteStateMessageSerializer.load(state) for state in request.state]
77+
78+
if request.custom_components_code:
79+
config_dict[INJECTED_COMPONENTS_PY] = request.custom_components_code
80+
config_dict[INJECTED_COMPONENTS_PY_CHECKSUMS] = {
81+
"md5": hashlib.md5(request.custom_components_code.encode()).hexdigest()
82+
}
83+
7684
source = safe_build_source(
7785
request.manifest.model_dump(),
7886
config_dict,
7987
catalog,
80-
request.state,
88+
converted_state,
8189
request.page_limit,
8290
request.slice_limit,
8391
request.record_limit,
8492
)
85-
state = [AirbyteStateMessageSerializer.load(state) for state in request.state]
86-
87-
if request.custom_components_code:
88-
config_dict[INJECTED_COMPONENTS_PY] = request.custom_components_code
89-
config_dict[INJECTED_COMPONENTS_PY_CHECKSUMS] = {
90-
"md5": hashlib.md5(request.custom_components_code.encode()).hexdigest()
91-
}
9293

9394
runner = ManifestCommandProcessor(source)
9495
cdk_result = runner.test_read(
9596
config_dict,
9697
catalog,
97-
state,
98+
converted_state,
9899
request.record_limit,
99100
request.page_limit,
100101
request.slice_limit,

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ ignore = [
210210
[tool.airbyte_ci]
211211
python_versions = ["3.10", "3.11"]
212212
optional_poetry_groups = ["dev"]
213-
poetry_extras = ["file-based", "vector-db-based"]
213+
poetry_extras = ["file-based", "vector-db-based", "manifest-server"]
214214
poe_tasks = ["check-ci"]
215215
mount_docker_socket = true
216216

0 commit comments

Comments
 (0)