Skip to content

Commit

Permalink
Custom collect_freshness macro updates (#3740)
Browse files Browse the repository at this point in the history
## What are you changing in this pull request and why?

In v1.5, the collect_freshness macro returns a `response` object instead
of just a `table` result. This affects anyone who's overriding this
macro. Add this behavioral change to the 1.5 migration guide:

https://docs.getdbt.com/guides/migration/versions/upgrading-to-v1.5 

Resolves #3331 

## Checklist
- [x] Review the [Content style
guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md)
and [About
versioning](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#adding-a-new-version)
so my content adheres to these guidelines.
- [ ] Needs review from product team
  • Loading branch information
nghi-ly authored Jul 21, 2023
2 parents 2e4ac4c + 5c68543 commit 9a44221
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ models:
```
Some options that could previously be specified before a sub-command can now only be specified afterward. For example, `dbt --profiles-dir . run` isn't valid anymore, and instead, you need to use `dbt run --profiles-dir .`


The built-in [collect_freshness](https://github.com/dbt-labs/dbt-core/blob/1.5.latest/core/dbt/include/global_project/macros/adapters/freshness.sql) macro now returns the entire `response` object, instead of just the `table` result. If you're using a custom override for `collect_freshness`, make sure you're also returning the `response` object; otherwise, some of your dbt commands will never finish. For example:

```sql
{{ return(load_result('collect_freshness')) }}
```

Finally: The [built-in `generate_alias_name` macro](https://github.com/dbt-labs/dbt-core/blob/1.5.latest/core/dbt/include/global_project/macros/get_custom_name/get_custom_alias.sql) now includes logic to handle versioned models. If your project has reimplemented the `generate_alias_name` macro with custom logic, and you want to start using [model versions](/docs/collaborate/govern/model-versions), you will need to update the logic in your macro. Note that, while this is **not** a prerequisite for upgrading to v1.5—only for using the new feature—we recommmend that you do this during your upgrade, whether you're planning to use model versions tomorrow or far in the future.

### For consumers of dbt artifacts (metadata)
Expand Down

0 comments on commit 9a44221

Please sign in to comment.