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

Clarifying BigQuery unit test #5367

Merged
merged 4 commits into from
Apr 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion website/docs/docs/build/unit-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ Now, we are introducing a new type of test to dbt - unit tests. In software prog
## Before you begin

- We currently only support unit testing SQL models.
- We currently don't support unit testing models that use recursive SQL.
- We currently only support adding unit tests to models in your _current_ project.
- We currently *don't* support unit testing models that use recursive SQL.
- You must specify all fields in a BigQuery STRUCT in a unit test. You cannot use only a subset of fields in a STRUCT.
- If your model has multiple versions, by default the unit test will run on *all* versions of your model. Read [unit testing versioned models](#unit-testing-versioned-models) for more information.
- Unit tests must be defined in a YML file in your `models/` directory.

Expand Down
3 changes: 3 additions & 0 deletions website/docs/reference/resource-properties/data-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ unit_tests:
struct_field: 'struct("Isha" as name, 22 as age)'
struct_of_struct_field: 'struct(struct(1 as id, "blue" as color) as my_struct)'
struct_array_field: ['struct(st_geogpoint(75, 45) as my_point)', 'struct(st_geogpoint(75, 35) as my_point)']
# Make sure to include all the fields in a BigQuery `struct` within the unit test.
# It's not currently possible to use only a subset of columns in a 'struct'


```

Expand Down
Loading