Skip to content

Latest commit

 

History

History
30 lines (23 loc) · 891 Bytes

sequential_values.md

File metadata and controls

30 lines (23 loc) · 891 Bytes

sequential_values (source)

This test confirms that a column contains sequential values. It can be used for both numeric values, and datetime values, as follows:

 seeds:
  - name: util_even_numbers
    columns:
      - name: i
        tests:
          - dbt_utils.sequential_values:
              interval: 2


  - name: util_hours
    columns:
      - name: date_hour
        tests:
          - dbt_utils.sequential_values:
              interval: 1
              datepart: 'hour'

Args:

  • interval (default=1): The gap between two sequential values
  • datepart (default=None): Used when the gaps are a unit of time. If omitted, the test will check for a numeric gap.

This test supports the group_by_columns parameter; see Grouping in tests for details.