{"id":22793429,"url":"https://github.com/fivetran/dbt_smart_run","last_synced_at":"2025-07-22T16:02:08.570Z","repository":{"id":187409627,"uuid":"611427309","full_name":"fivetran/dbt_smart_run","owner":"fivetran","description":"Run your dbt models efficiently using dbt_smart_run","archived":false,"fork":false,"pushed_at":"2025-03-05T23:29:30.000Z","size":21,"stargazers_count":14,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-08T19:03:22.458Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fivetran.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-03-08T20:03:24.000Z","updated_at":"2025-05-14T18:10:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"84387850-51f8-4495-8064-23e5f255f72d","html_url":"https://github.com/fivetran/dbt_smart_run","commit_stats":null,"previous_names":["fivetran/dbt_smart_run"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fivetran/dbt_smart_run","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fivetran%2Fdbt_smart_run","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fivetran%2Fdbt_smart_run/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fivetran%2Fdbt_smart_run/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fivetran%2Fdbt_smart_run/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fivetran","download_url":"https://codeload.github.com/fivetran/dbt_smart_run/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fivetran%2Fdbt_smart_run/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266524840,"owners_count":23942829,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-12T03:19:51.947Z","updated_at":"2025-07-22T16:02:08.499Z","avatar_url":"https://github.com/fivetran.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Notice!\nThis code was open-sourced in support of [this blog post](https://www.fivetran.com/blog/how-we-execute-dbt-runs-faster-and-cheaper). It is not actively maintained by the Fivetran team but you are welcome to fork and use the repo for yourselves.\n\n# dbt_smart_run\n# 📣 What does this dbt package do?\nDo you find yourself wasting time looking through your data lineage DAG trying to figure out which models to run?  What about wanting to save on the costs of running your dbt models? Do your dbt runs take forever?\n\nTo solve these problems, we developed “dbt smart run”.  Our way of running only the models that need to run without wasting your brain-power to figure out how to craft your dbt run command. \n\nNote: This package is currently only supported on BigQuery.  However, if you use another data warehouse, you can use majority of the code and make the necessary edits to work with your data warehouse.\n\n# 🎯 How do I use the dbt package?\n## Step 1: Copy all required file from this repo to your own.\n\n+ dbt_smart_run.py\n\n+ All files in the macros folder, including:\n  + dbt_smart_run.sql\n  + generate_schema_name.sql\n  + get_all_upstream_reference_models.sql\n  + is_valid_model_list.sql\n  + copy_prod_to_target.sql\n  + create_or_replace_prod_to_target.sql\n  + reset_dev_for_list_of_models.sql\n\n\u003e Note: These files will need to be stored in your dbt project's macro folder.\n\n+ requirements.txt\n\n## Step 2: Install the dbt_utils package\n(Skip if you already have a dependency on dbt_utils)\n\nBe sure you've included the dbt_utils package to your `packages.yml` file\n\u003e TIP: Check [dbt Hub](https://hub.getdbt.com/) for the latest installation instructions or [read the dbt docs](https://docs.getdbt.com/docs/package-management) for more information on installing packages.\n```yaml\npackages:\n  - package: dbt-labs/dbt_utils\n    version: [\"\u003e=0.8.0\", \"\u003c0.9.0\"]\n```\n\u003e Note, your range may differ if you are already using dbt_utils. If using a different version, the ability to run log_info is a requirement.\n\n## Step 3: Install required python packages\nInstall dependencies by running the following:\n ```\n $ pip3 install -r ../requirements.txt\n ```\n\n## Step 4: Run dbt_smart_run\nFrom your terminal, run the following command to run your dbt models. \n\nFor one target model:\n```\n$ python3 dbt_smart_run.py -targets your_target_model\n```\n\nFor multiple target models:\n```\n$ python3 dbt_smart_run.py -targets your_first_target_model your_second_target_model\n```\n\nHere's an example of what to expect from your terminal output:\n\n\u003cimg width=\"1282\" alt=\"Screenshot 2023-03-13 at 11 32 53 AM\" src=\"https://user-images.githubusercontent.com/54283769/225139201-0901cb84-7361-4c27-891d-9c66f540ad44.png\"\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffivetran%2Fdbt_smart_run","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffivetran%2Fdbt_smart_run","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffivetran%2Fdbt_smart_run/lists"}