Skip to content

Commit

Permalink
[#5218] Fix Configuration for max_staleness should be string with exp…
Browse files Browse the repository at this point in the history
…licit format, instead of integer (#5220)

Resolves #5218 

## What are you changing in this pull request and why?
As stated in the issue description, while following the example code
snippets in the [Optimizing Materialized Views with dbt
](https://docs.getdbt.com/blog/announcing-materialized-views) page to
setup materialized views in BigQuery, I got a database error when I
defined `max_staleness=60` (as described in the blog).

When I instead changed that line of the `config` block to
`max_staleness='INTERVAL 60 MINUTE'`, the model successfully
materialized.

## Checklist

- [X] Review the [Content style
guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md)
so my content adheres to these guidelines.
- [X]  Needs technical review

### Additional information

I tested with:
- `dbt-core`   v1.7.3
- `dbt-bigquery`  v1.7.1
  • Loading branch information
amychen1776 authored Apr 3, 2024
2 parents e83f31d + 5cbaae0 commit 96b3982
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion website/blog/2023-08-01-announcing-materialized-views.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ config(
on_configuration_change = 'apply',
enable_refresh = True,
refresh_interval_minutes = 30
max_staleness = 60,
max_staleness = 'INTERVAL 60 MINUTE'
)
}}
```
Expand Down

0 comments on commit 96b3982

Please sign in to comment.