Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for dbt config-blocks #64

Open
romeo-alexander opened this issue Jan 6, 2025 · 0 comments
Open

Add support for dbt config-blocks #64

romeo-alexander opened this issue Jan 6, 2025 · 0 comments

Comments

@romeo-alexander
Copy link

As far as I can tell, when it comes to model configs (eg. tags, pre/post hooks, materialization, enablement/disablement) in dbt-ibs, we can only specify them in either the dbt_project.yml project file, or a properties.yml file. Having dbt-ibs support the specification of these configs directly in the .ibis file, so that they are precompiled as a jinja dbt config block, would be very useful.

For example, it would be good to have the flexibility to specify configs in the following way:

@config(
    {
        "enabled": True if get_flags().target == "batch" else False,
    }
)
def model(table):
    return table

or

@config(
    {
        "materialized": "table" if get_flags().target == "batch" else "view",
    }
)
def model(table):
    return table

The idea is that the vast majority of the query logic applies to the multiple database contexts I may want to manager (specifically, batch and streaming), but to handle the parts that are different (eg. materialization, handling "now()"), being able to switch contexts directly in a config decorator would prevent having to maintain entirely separate dbt projects for each database context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant