Skip to content

Commit 951d087

Browse files
authored
Set the correct language identifier in the code block of the document (#876)
1 parent fe0e8eb commit 951d087

File tree

2 files changed

+32
-32
lines changed

2 files changed

+32
-32
lines changed

CHANGELOG.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,14 @@ The call signature of `deduplicate` has changed. The previous call signature is
181181
- The `relation_alias` argument has been removed as the macro now supports `relation` as a string directly. If you were using `relation_alias` to point to a CTE previously then you can now pass the alias directly to `relation`.
182182

183183
Before:
184-
```jinja
184+
```sql
185185
{% macro deduplicate(relation, group_by, order_by=none, relation_alias=none) -%}
186186
...
187187
{% endmacro %}
188188
```
189189

190190
After:
191-
```jinja
191+
```sql
192192
{% macro deduplicate(relation, partition_by, order_by) -%}
193193
...
194194
{% endmacro %}
@@ -376,20 +376,20 @@ In accordance with the version upgrade, this package release includes breaking c
376376
The order of (optional) arguments has changed in the `get_column_values` macro.
377377

378378
Before:
379-
```jinja
379+
```sql
380380
{% macro get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none) -%}
381381
...
382382
{% endmacro %}
383383
```
384384

385385
After:
386-
```jinja
386+
```sql
387387
{% macro get_column_values(table, column, max_records=none, default=none) -%}
388388
...
389389
{% endmacro %}
390390
```
391391
If you were relying on the position to match up your optional arguments, this may be a breaking change — in general, we recommend that you explicitly declare any optional arguments (if not all of your arguments!)
392-
```
392+
```sql
393393
-- before: This works on previous version of dbt-utils, but on 0.7.0, the `50` would be passed through as the `order_by` argument
394394
{% set payment_methods = dbt_utils.get_column_values(
395395
ref('stg_payments'),
@@ -481,7 +481,7 @@ If you were relying on the position to match up your optional arguments, this ma
481481
- If your project uses the `get_tables_by_prefix` macro, replace it with `get_relations_by_prefix`. All arguments have retained the same name.
482482
- If your project uses the `union_tables` macro, replace it with `union_relations`. While the order of arguments has stayed consistent, the `tables` argument has been renamed to `relations`. Further, the default value for the `source_column_name` argument has changed from `'_dbt_source_table'` to `'_dbt_source_relation'` — you may want to explicitly define this argument to avoid breaking changes.
483483

484-
```
484+
```sql
485485
-- before:
486486
{{ dbt_utils.union_tables(
487487
tables=[ref('my_model'), source('my_source', 'my_table')],

README.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ models:
498498
This test confirms that a column contains sequential values. It can be used
499499
for both numeric values, and datetime values, as follows:
500500

501-
```yml
501+
```yaml
502502
version: 2
503503
504504
seeds:
@@ -627,7 +627,7 @@ This feature is currently available for the following tests:
627627

628628
To use this feature, the names of grouping variables can be passed as a list. For example, to test for at least one valid value by group, the `group_by_columns` argument could be used as follows:
629629

630-
```
630+
```yaml
631631
- name: data_test_at_least_one
632632
columns:
633633
- name: field
@@ -726,7 +726,7 @@ This macro is particularly handy when paired with `union_relations`.
726726

727727
**Usage:**
728728

729-
```
729+
```sql
730730
-- Returns a list of relations that match schema_pattern%.table
731731
{% set relations = dbt_utils.get_relations_by_pattern('schema_pattern%', 'table_pattern') %}
732732
@@ -781,7 +781,7 @@ handy paired with `union_relations`.
781781

782782
**Usage:**
783783

784-
```
784+
```sql
785785
-- Returns a list of relations that match schema.prefix%
786786
{% set relations = dbt_utils.get_relations_by_prefix('my_schema', 'my_prefix') %}
787787

@@ -807,7 +807,7 @@ This macro returns a dictionary from a sql query, so that you don't need to inte
807807

808808
**Usage:**
809809

810-
```
810+
```sql
811811
{% set sql_statement %}
812812
select city, state from {{ ref('users') }}
813813
{% endset %}
@@ -835,7 +835,7 @@ This macro returns a single value from a sql query, so that you don't need to in
835835

836836
**Usage:**
837837

838-
```
838+
```sql
839839
{% set sql_statement %}
840840
select max(created_at) from {{ ref('processed_orders') }}
841841
{% endset %}
@@ -860,7 +860,7 @@ This macro returns the sql required to build a date spine. The spine will includ
860860

861861
**Usage:**
862862

863-
```
863+
```sql
864864
{{ dbt_utils.date_spine(
865865
datepart="day",
866866
start_date="cast('2019-01-01' as date)",
@@ -881,7 +881,7 @@ This macro returns the sql required to remove duplicate rows from a model, sourc
881881

882882
**Usage:**
883883

884-
```
884+
```sql
885885
{{ dbt_utils.deduplicate(
886886
relation=source('my_source', 'my_table'),
887887
partition_by='user_id, cast(timestamp as day)',
@@ -890,7 +890,7 @@ This macro returns the sql required to remove duplicate rows from a model, sourc
890890
}}
891891
```
892892

893-
```
893+
```sql
894894
{{ dbt_utils.deduplicate(
895895
relation=ref('my_model'),
896896
partition_by='user_id',
@@ -899,7 +899,7 @@ This macro returns the sql required to remove duplicate rows from a model, sourc
899899
}}
900900
```
901901

902-
```
902+
```sql
903903
with my_cte as (
904904
select *
905905
from {{ source('my_source', 'my_table') }}
@@ -922,7 +922,7 @@ Optionally takes a `unit` string argument ('km' or 'mi') which defaults to miles
922922

923923
**Usage:**
924924

925-
```
925+
```sql
926926
{{ dbt_utils.haversine_distance(48.864716, 2.349014, 52.379189, 4.899431) }}
927927

928928
{{ dbt_utils.haversine_distance(
@@ -948,7 +948,7 @@ This macro builds a group by statement for fields 1...N
948948

949949
**Usage:**
950950

951-
```
951+
```sql
952952
{{ dbt_utils.group_by(n=3) }}
953953
```
954954

@@ -1017,7 +1017,7 @@ relations will be filled with `null` where not present. A new column
10171017

10181018
**Usage:**
10191019

1020-
```
1020+
```sql
10211021
{{ dbt_utils.union_relations(
10221022
relations=[ref('my_model'), source('my_source', 'my_table')],
10231023
exclude=["_loaded_at"]
@@ -1043,7 +1043,7 @@ This macro implements a cross-database mechanism to generate an arbitrarily long
10431043

10441044
**Usage:**
10451045

1046-
```
1046+
```sql
10471047
{{ dbt_utils.generate_series(upper_bound=1000) }}
10481048
```
10491049

@@ -1053,7 +1053,7 @@ This macro implements a cross-database way to generate a hashed surrogate key us
10531053

10541054
**Usage:**
10551055

1056-
```
1056+
```sql
10571057
{{ dbt_utils.generate_surrogate_key(['field_a', 'field_b'[,...]]) }}
10581058
```
10591059

@@ -1071,7 +1071,7 @@ This macro implements a cross-database way to sum nullable fields using the fiel
10711071
10721072
**Usage:**
10731073
1074-
```
1074+
```sql
10751075
{{ dbt_utils.safe_add(['field_a', 'field_b', ...]) }}
10761076
```
10771077

@@ -1086,7 +1086,7 @@ This macro performs division but returns null if the denominator is 0.
10861086

10871087
**Usage:**
10881088

1089-
```
1089+
```sql
10901090
{{ dbt_utils.safe_divide('numerator', 'denominator') }}
10911091
```
10921092

@@ -1096,7 +1096,7 @@ This macro implements a cross-database way to take the difference of nullable fi
10961096

10971097
**Usage:**
10981098

1099-
```
1099+
```sql
11001100
{{ dbt_utils.safe_subtract(['field_a', 'field_b', ...]) }}
11011101
```
11021102

@@ -1106,7 +1106,7 @@ This macro pivots values from rows to columns.
11061106

11071107
**Usage:**
11081108

1109-
```
1109+
```sql
11101110
{{ dbt_utils.pivot(<column>, <list of values>) }}
11111111
```
11121112

@@ -1187,7 +1187,7 @@ Boolean values are replaced with the strings 'true'|'false'
11871187

11881188
**Usage:**
11891189

1190-
```
1190+
```sql
11911191
{{ dbt_utils.unpivot(
11921192
relation=ref('table_name'),
11931193
cast_to='datatype',
@@ -1251,7 +1251,7 @@ When an expression falls outside the range, the function returns:
12511251

12521252
**Usage:**
12531253

1254-
```
1254+
```sql
12551255
{{ dbt_utils.width_bucket(expr, min_value, max_value, num_buckets) }}
12561256
```
12571257

@@ -1263,7 +1263,7 @@ This macro extracts a url parameter from a column containing a url.
12631263

12641264
**Usage:**
12651265

1266-
```
1266+
```sql
12671267
{{ dbt_utils.get_url_parameter(field='page_url', url_parameter='utm_source') }}
12681268
```
12691269

@@ -1273,7 +1273,7 @@ This macro extracts a hostname from a column containing a url.
12731273

12741274
**Usage:**
12751275

1276-
```
1276+
```sql
12771277
{{ dbt_utils.get_url_host(field='page_url') }}
12781278
```
12791279

@@ -1283,7 +1283,7 @@ This macro extracts a page path from a column containing a url.
12831283

12841284
**Usage:**
12851285

1286-
```
1286+
```sql
12871287
{{ dbt_utils.get_url_path(field='page_url') }}
12881288
```
12891289

@@ -1329,7 +1329,7 @@ This macro logs a formatted message (with a timestamp) to the command line.
13291329
{{ dbt_utils.log_info("my pretty message") }}
13301330
```
13311331

1332-
```
1332+
```shell
13331333
11:07:28 | 1 of 1 START table model analytics.fct_orders........................ [RUN]
13341334
11:07:31 + my pretty message
13351335
```
@@ -1402,7 +1402,7 @@ In `dbt_project.yml`, you can define a project-level `dispatch` config that enab
14021402

14031403
Set the config in `dbt_project.yml`:
14041404

1405-
```yml
1405+
```yaml
14061406
dispatch:
14071407
- macro_namespace: dbt_utils
14081408
search_order:

0 commit comments

Comments
 (0)