Commit 62ba126
feat: Add InferredSchemaLoader for runtime schema inference
Add a new InferredSchemaLoader component that infers JSON schemas by reading
a sample of records from the stream at discover time. This enables declarative
connectors to automatically generate schemas for streams where the schema is
not known in advance or changes dynamically.
Key features:
- Reads up to record_sample_size records (default 100) from the stream
- Uses SchemaInferrer to generate JSON schema from sample records
- Handles errors gracefully by returning empty schema
- Fully integrated with declarative component schema and model factory
- Includes comprehensive unit tests
Requested by: AJ Steers ([email protected]) @aaronsteers
Co-Authored-By: AJ Steers <[email protected]>1 parent 6504148 commit 62ba126
File tree
6 files changed
+516
-60
lines changed- airbyte_cdk/sources/declarative
- models
- parsers
- schema
- unit_tests/sources/declarative/schema
6 files changed
+516
-60
lines changedLines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1548 | 1548 | | |
1549 | 1549 | | |
1550 | 1550 | | |
| 1551 | + | |
1551 | 1552 | | |
1552 | 1553 | | |
1553 | 1554 | | |
1554 | 1555 | | |
1555 | 1556 | | |
1556 | 1557 | | |
1557 | 1558 | | |
| 1559 | + | |
1558 | 1560 | | |
1559 | 1561 | | |
1560 | 1562 | | |
| |||
2462 | 2464 | | |
2463 | 2465 | | |
2464 | 2466 | | |
| 2467 | + | |
| 2468 | + | |
| 2469 | + | |
| 2470 | + | |
| 2471 | + | |
| 2472 | + | |
| 2473 | + | |
| 2474 | + | |
| 2475 | + | |
| 2476 | + | |
| 2477 | + | |
| 2478 | + | |
| 2479 | + | |
| 2480 | + | |
| 2481 | + | |
| 2482 | + | |
| 2483 | + | |
| 2484 | + | |
| 2485 | + | |
| 2486 | + | |
| 2487 | + | |
| 2488 | + | |
| 2489 | + | |
| 2490 | + | |
| 2491 | + | |
| 2492 | + | |
| 2493 | + | |
| 2494 | + | |
| 2495 | + | |
| 2496 | + | |
| 2497 | + | |
| 2498 | + | |
| 2499 | + | |
| 2500 | + | |
2465 | 2501 | | |
2466 | 2502 | | |
2467 | 2503 | | |
| |||
0 commit comments