feat: Phase 2 DuckDB data exchange + E2B Simple Adapter (ADR-0041)#67
Merged
feat: Phase 2 DuckDB data exchange + E2B Simple Adapter (ADR-0041)#67
Conversation
Migrate all drivers from DataFrame-based to DuckDB table-based data
exchange as specified in ADR 0043.
## Changes
### Drivers Migrated
- MySQL extractor: streaming via SQLAlchemy yield_per to DuckDB tables
- PostHog extractor: pagination streams to DuckDB, preserves state
- GraphQL extractor: pagination streams to DuckDB tables
- DuckDB processor: reads/writes tables in shared database
- Supabase writer: reads from DuckDB tables (dual-mode for compat)
### Runtime Updates
- runner_v0: input resolution handles table references
- proxy_worker: removed spilling logic (~50 lines), simplified result caching
### New API Contract
- Extractors return: {"table": step_id, "rows": count}
- Writers accept: inputs["table"] with table name
- All data flows through shared pipeline_data.duckdb
### Benefits
- Memory: O(batch_size) constant instead of O(n)
- No spilling: eliminated Parquet save/load workaround
- Query pushdown: SQL directly on DuckDB tables
- Simpler code: one shared database per session
### Tests Updated
- test_duckdb_multi_input.py: new MockContext pattern
- test_filesystem_csv_extractor.py: expect table-based output
- test_graphql_extractor_driver.py: MockContext with DuckDB
- ADR 0043: Change status from "Proposed" to "Accepted" - Add Phase 2 completion document with migration details - Update CLAUDE.md driver development guidelines: - Add ctx.get_db_connection() to Context API - Replace DataFrame-based patterns with DuckDB table patterns - Add Extractor, Processor, Writer pattern examples - Remove legacy df_*/df key handling documentation
- Implement E2BSimpleAdapter for PyPI-based E2B execution (~100 lines vs ~1500 ProxyWorker)
- Add targeted secret injection: scan osiris_connections.yaml for ${VAR} refs instead of leaking all secret-like env vars
- Add --stream-events CLI flag for JSON Lines event/metric output
- Add 14 unit tests for adapter (init, prepare, execute, collect, stdout parsing, env var extraction)
- Fix path handling and session logging across codebase for DuckDB migration compatibility
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
osiris_connections.yamlvia${VAR}patterns are forwarded to the sandbox (replaces naive pattern-matching that leaked unrelated secrets)--stream-eventsCLI flag: Enables JSON Lines output of events/metrics to stdout for PyPI-based E2B executionTest plan