feat(caches): Add DuckLakeCache implementation (do not merge)#695
feat(caches): Add DuckLakeCache implementation (do not merge)#695devin-ai-integration[bot] wants to merge 14 commits into
Conversation
…tion - Add DuckLakeCache as subclass of DuckDBCache following MotherDuck pattern - Support DuckLake table format with metadata database and Parquet storage - Provide sensible defaults using cache_dir pattern: - db_path defaults to 'ducklake.db' in cache directory - metadata_connection_string defaults to 'sqlite:metadata.db' in cache directory - data_path defaults to 'data' subdirectory in cache directory - catalog_name defaults to 'ducklake_catalog' - Enable minimal configuration requiring only catalog_name parameter - Add example script demonstrating usage with source-faker - Export DuckLakeCache and DuckLakeConfig in caches module Co-Authored-By: AJ Steers <aj@airbyte.io>
|
Original prompt from AJ Steers: |
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Aaron ("AJ") Steers (aaronsteers)
left a comment
There was a problem hiding this comment.
Devin - I'm applying several changes to your PR. Wait 30 seconds and then pull the latest.
| def get_database_name(self) -> str: | ||
| """Return the name of the database.""" | ||
| if self.db_path == ":memory:": | ||
| return "memory" | ||
|
|
||
| split_on = "\\" if "\\" in str(self.db_path) else "/" | ||
|
|
||
| return str(self.db_path).split(sep=split_on)[-1].split(".")[0] |
There was a problem hiding this comment.
I am not sure, but I believe this should just return self.catalog_name.
- Fix MyPy errors by moving path resolution to model_post_init method - Update get_database_name() to return catalog_name instead of parsing db_path - Remove unused imports and fix linting issues - Preserve AJ's documentation improvements for data_path and storage_credentials Co-Authored-By: AJ Steers <aj@airbyte.io>
- Update duckdb dependency from ^1.1.0 to ^1.3.1 - Update duckdb-engine dependency from ^0.13.2 to ^0.17.0 - Add DuckLakeSqlProcessor with ATTACH statement handling - Update example script to use ducklake-data directory for verification - Verify DuckLake extension works and files land in correct directory Co-Authored-By: AJ Steers <aj@airbyte.io>
…with ducklake-data path Co-Authored-By: AJ Steers <aj@airbyte.io>
Co-Authored-By: AJ Steers <aj@airbyte.io>
|
/fix-pr
|
|
Closing due to inactivity for more than 7 days. Configure here. |
Notes from AJ (Aaron ("AJ") Steers (@aaronsteers))
Most of the implementation appears read to go when the below features is added.
🟥 BlockedAs of now, it appears UPDATE/MERGE are not yet supported:
Workaround found: First DELETE, then INSERT.
Add DuckLakeCache implementation
Summary
This PR implements a new
DuckLakeCacheas a subclass ofDuckDBCacheto support the DuckLake table format in PyAirbyte. The implementation follows the established patterns from MotherDuck cache and provides minimal configuration requirements.Changes
airbyte/caches/ducklake.pyDuckLakeConfigclass extendingDuckDBConfigwith DuckLake-specific fieldsDuckLakeCacheclass extendingDuckDBCachewith minimal configurationairbyte/caches/__init__.pyto export new classesexamples/run_faker_to_ducklake.pydemonstrating usageConfiguration Parameters
metadata_connection_string: Connection string for DuckLake metadata database (defaults tosqlite:metadata.db)data_path: Local directory for Parquet data files (defaults todatasubdirectory)catalog_name: Name for attached DuckLake catalog (defaults toducklake_catalog)storage_credentials: Optional dict for storage credentials (defaults to None)Key Features
catalog_namerequired, all other fields have sensible defaults.cachedirectory pattern for default pathsUsage Example
Testing
ruff format,ruff check)Implementation Notes
Link to Devin run
https://app.devin.ai/sessions/1a262eb5a472438ba8f04088ad0b91bb
Requested by
AJ Steers (aj@airbyte.io)