Skip to content

Commit

Permalink
remove extra base class
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronsteers committed Feb 20, 2024
1 parent c042fa2 commit 7079f0d
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions airbyte/caches/duckdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@


class DuckDBCache(SQLCacheConfigBase, ParquetWriterConfig):
"""Configuration for the DuckDB cache.
"""A DuckDB cache.
Also inherits config from the ParquetWriter, which is responsible for writing files to disk.
"""
Expand Down Expand Up @@ -54,8 +54,10 @@ def get_database_name(self) -> str:
# Return the file name without the extension
return str(self.db_path).split("/")[-1].split(".")[0]

_instance: DuckDBCacheInstance | None = None

class DuckDBCacheBase(SQLCacheBase):

class DuckDBCacheInstance(SQLCacheBase):
"""A DuckDB implementation of the cache.
Parquet is used for local file storage before bulk loading.
Expand All @@ -65,6 +67,7 @@ class DuckDBCacheBase(SQLCacheBase):

config_class = DuckDBCache
supports_merge_insert = False
file_writer_class = ParquetWriter

@overrides
def get_telemetry_info(self) -> CacheTelemetryInfo:
Expand All @@ -80,17 +83,6 @@ def _setup(self) -> None:

Path(config.db_path).parent.mkdir(parents=True, exist_ok=True)


class DuckDBCacheInstance(DuckDBCacheBase):
"""A DuckDB implementation of the cache.
Parquet is used for local file storage before bulk loading.
Unlike the Snowflake implementation, we can't use the COPY command to load data
so we insert as values instead.
"""

file_writer_class = ParquetWriter

# TODO: Delete or rewrite this method after DuckDB adds support for primary key inspection.
# @overrides
# def _merge_temp_table_to_final_table(
Expand Down

0 comments on commit 7079f0d

Please sign in to comment.