<@U088WCP3B4P> Is it expected that the elementary ...
# ask-elementary-ai
n
@kapa.ai Is it expected that the elementary models are built when i "dbt build -s models/"? Is it good practice to build them regularly?
k
A message from kapa.ai
It is not expected that the Elementary models are built when you run
dbt build -s models/
, unless your selection includes the Elementary package models (e.g., if your selector pattern matches them). By default, Elementary models are only built if you explicitly select them (e.g.,
dbt build -s elementary
or
dbt build --select package:elementary
). If you do not want to build Elementary models as part of your regular model builds, you should ensure your selector does not include them. As for best practices: you do not need to build Elementary models regularly. The recommended approach is to build the Elementary models only when you first install the package or when you upgrade to a new (minor) version, as this is when schema changes may occur. After that, the on-run-end hooks will keep the relevant tables up to date with metadata and test results, so regular builds of the Elementary models are unnecessary and do not provide additional benefit. Running them more often is harmless, but not required and may consume unnecessary resources [When to run elementary models](https://slack.com/archives/C02CTC89LAX/p1741272625948369) [Elementary dbt artifacts docs](https://docs.elementary-data.com/dbt/dbt-artifacts). In summary: - Elementary models should not be built with every
dbt build -s models/
unless you explicitly include them. - It is not good practice to build them regularly; only do so on installation or minor version upgrades.
n
@kapa.ai any idea why the elementary models are built with "dbt build -s models/" ? Is it because the also match the
models/
path in their dbt project repository?
k
A message from kapa.ai
Yes, the reason Elementary models are built when you run
dbt build -s models/
is because the Elementary package's models are also located under the
models/
directory in your dbt project. The selector
-s models/
matches all models in that directory, including those from installed packages like Elementary, unless you specifically exclude them. This behavior is confirmed in community discussions, where users observed that running selectors that include the
models/
path will also pick up Elementary models, since they reside in the same directory structure as your project's models. If you want to avoid building Elementary models unintentionally, you should adjust your selector to exclude them or use more specific selection criteria [Slack discussion on model selection](https://slack.com/archives/C02CTC89LAX/p1689861891276609). In summary: Elementary models are built with
dbt build -s models/
because they are physically present in the
models/
directory, and the selector matches all models in that path, including those from packages.