What is the best practice for loading the latest d...
# ask-community
j
What is the best practice for loading the latest dbt project from a git repository? I currently load the asset like this, but have to make sure manually that it is the latest version. The asset file is only executed when it is loaded, so just updating it before loading the asset would not be enough, right?
Copy code
# my_asset.py
# Updating the git repository here is not enough.
dbt_asset = with_resources(
    load_assets_from_dbt_project(DBT_PROJECT_PATH, profiles_dir=DBT_PROFILES),
    {"dbt": dbt_cli_resource.configured({"project_dir": DBT_PROJECT_PATH})},
)
Oh, I guess you are supposed to update it as part of your CI/CD pipeline?
t
Hi! Yes, the best practice is to pull the repo or build the manifest during your CD step when you deploy your Dagster project.
j
That sounds like a great solution, thanks!
Could you share a code snippet on how to load the github repository at definition time?
I am running into some issues there since the module seems to be loaded multiple times.