Skip to content

Commit

Permalink
adapt readme; add default materialization config
Browse files Browse the repository at this point in the history
  • Loading branch information
milicevica23 committed Oct 25, 2023
1 parent 6ec7466 commit b48be37
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dbt/adapters/duckdb/environments/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def load_source(self, plugin_name: str, source_config: utils.SourceConfig):
df = plugin.load(source_config)
assert df is not None

materialization = source_config.meta.get("materialization", "table")
materialization = source_config.meta.get("materialization", plugin.default_materialization())
source_table_name = source_config.table_name()
df_name = source_table_name.replace(".", "_") + "_df"

Expand Down
3 changes: 3 additions & 0 deletions dbt/adapters/duckdb/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,6 @@ def configure_cursor(self, cursor):
:param cursor: A DuckDBPyConnection instance to be configured.
"""
pass

def default_materialization(self):
return "table"
2 changes: 2 additions & 0 deletions dbt/adapters/duckdb/plugins/delta.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ def load(self, source_config: SourceConfig):

return df

def default_materialization(self):
return "view"

# Future
# TODO add databricks catalog

0 comments on commit b48be37

Please sign in to comment.