-
Over at prql/dbt-prql — the dbt integration for prql — I'm trying to write some tests to ensure that PRQL queries are parsed into SQL in dbt models. This currently involves: This isn't great, since even A couple of questions:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Yes! In plugins, in packages — really, wherever you can install and run Existing documentation: https://docs.getdbt.com/docs/contributing/testing-a-new-adapter. Note that you don't actually need to be testing an adapter to use this. There's a discussion about this, which will hopefully turn into a developer blog post / guide: dbt-labs/docs.getdbt.com#1808
Hmm. Appreciate the added overhead required by having a live DB connection. The time overhead does go down significantly if you're using a local or in-memory database (Postgres, DuckDB, SQLite), but it does still require a bit of additional setup. There isn't any reusable tooling we've developed to effectively mock the database connection, such that you can unit-test runtime behavior, including compilation. I do think this would be a highly valuable addition to the @max-sixty As a separate line of inquiry — something that's been in my head for a little while now, not really relevant to the narrow scope of this discussion, but here we both are — I'd be interested in imagining a more fundamental integration between prql + dbt. Python models in dbt do not use Jinja at all (at least, not really). We use Python's own AST to parse out |
Beta Was this translation helpful? Give feedback.
Yes! In plugins, in packages — really, wherever you can install and run
dbt-core
+pytest
.Existing documentation: https://docs.getdbt.com/docs/contributing/testing-a-new-adapter. Note that you don't actually need to be testing an adapter to use this.
There's a discussion about this, which will hopefully turn into a developer blog post / guide: dbt-labs/docs.getdbt.com#1808
Hmm. Appreciate the added overhead required by having a live DB connection. The time overhead does go down significantly if you're using a local or in-memory database (Postgres, DuckDB, SQL…