Skip to content

Commit 733dcb9

Browse files
authored
Merge pull request dbt-labs#155 from fishtown-analytics/fix/get_tables_by_prefix_docs
Fix docs for get_tables_by_prefix
2 parents f3ec633 + f3df998 commit 733dcb9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

README.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,14 @@ exclusion pattern. It's particularly handy paired with `union_tables`.
237237
Usage:
238238
```
239239
-- Returns a list of tables that match schema.prefix%
240-
{{ set tables = dbt_utils.get_tables_by_prefix('schema', 'prefix')}}
240+
{% set tables = dbt_utils.get_tables_by_prefix('schema', 'prefix') %}
241241
242242
-- Returns a list of tables as above, excluding any with underscores
243-
{{ set tables = dbt_utils.get_tables_by_prefix('schema', 'prefix', '%_%')}}
243+
{% set tables = dbt_utils.get_tables_by_prefix('schema', 'prefix', '%_%') %}
244+
245+
-- Example using the union_tables macro
246+
{% set event_tables = dbt_utils.get_tables_by_prefix('events', 'event_') %}
247+
{{ dbt_utils.union_tables(tables = event_tables) }}
244248
```
245249

246250
#### group_by ([source](macros/sql/groupby.sql))

0 commit comments

Comments
 (0)