Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support sql as a unit test format #140

Open
joellabes opened this issue May 17, 2024 · 0 comments
Open

Support sql as a unit test format #140

joellabes opened this issue May 17, 2024 · 0 comments

Comments

@joellabes
Copy link
Collaborator

image
  - name: reworked_compare_struct
    model: unit_reworked_compare_struct
    given:
      - input: ref('unit_test_struct_model_a')
        format: sql
        rows: |
          select 1 as id, 'John Doe' as col1, object_construct('street', '123 Main St', 'city', 'Anytown', 'state', 'CA') as col2
      - input: ref('unit_test_struct_model_b')
        format: sql
        rows: |
          select 1 as id, 'John Doe' as col1, object_construct('street', '123 Main St', 'city', 'Anytown', 'state', 'CA') as col2
    expect:
      rows:
        - {"id": 1, "dbt_audit_row_status": "identical", "dbt_audit_num_rows_in_status": 1}
    overrides:
      vars:
        reworked_compare__columns: ['id', 'col1', 'col2']
        reworked_compare__event_time:
        reworked_compare__primary_key_columns: ['id']

sql format has rows as a string, and also supports defining a fixture. Basically the same as csv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant