duckdb / dbt-duckdb

dbt (http://getdbt.com) adapter for DuckDB (http://duckdb.org)
Apache License 2.0
882 stars 78 forks source link

When customizing a plugin, how do I pass the current model customization options? #255

Closed l1xnan closed 1 year ago

l1xnan commented 1 year ago

Custom a plugin:

class Plugin(BasePlugin):
    def initialize(self, plugin_config: Dict[str, Any]):
        pass

    def load(self, source_config: SourceConfig) -> pd.DataFrame:
        pass

    def store(self, target_config: TargetConfig):
        pass

how to get meta in method store:

models:
  - name: new_demo
    meta:
      custom: test

or to get custom:

-- ./models/new_demo.sql
{{ config(materialized="external", plugin="sql", custom="test") }}
select * from demo where status=1
jwills commented 1 year ago

I don't think I'm passing it in right now to the TargetConfig class, but I don't think it wouldn't be too hard to add it, let me take a look now...