expect_table_row_count_to_equal
Feb 24, 2026
·
5
min read
Volume
·
dbt-expectations
·
Model,Seed,Source
How it Works
The expect_table_row_count_to_equal test from the dbt-expectations package asserts that a model, seed, or source contains exactly a specified number of rows. This is most commonly used with seed files or reference tables whose row count is known and fixed, such as lookup tables or currency lists.
Steps and Conditions
Set Expected Count: Provide the exact expected row count using
value.Optional Group By: Apply
group_byto check counts within subgroups.Execution: The actual row count is computed and compared to the expected value.
Outcome: Pass if counts match exactly; fail if they differ.
Example Usage: Reference Data
A data team maintains a currency_codes seed file that should always contain exactly 180 rows (one per ISO currency).
Any accidental addition or deletion of rows in the seed file will be caught before deployment.





