dbt Python model (dbt-py) best practices

This discussion will be used for dbt-py model best practices. Contribute your opinions on best practices or ask us about them! We’re early on this journey. Some things you shouldn’t do:

  • use Python for hitting external APIs for EL tasks (caveat: light data enrichment may be okay)

dbt-py models, like dbt-sql models, are for transformation code – the equivalent of a select statement. You should configure your model as need, dbt.ref and dbt.source upstream data, write data transformation code, and return a data object to be persisted in the data platform at the end.