## TL;DR
Check the batch boundaries before questioning the data URIs expect_table_row_count_to_be_between evaluates the exact batch the validator loaded, so a filtered batch, a sampled batch, or an empty partition fails even when the table itself is healthy. Print the actual row count and the batch filter, then fix the batch definition or the bounds.

```text
great expectations expect_table_row_count_to_be_between failed error
```

## Use this when
- The check or run fails with this symptom: expect_table_row_count_to_be_between fails with a count outside the configured range.
- You are working on a Great Expectations suite with a table row count expectation and the failure repeats on the same data or configuration.
- You need the failing rows, rule, or stage isolated before changing thresholds or code.

## Not for this skill when
- Row count checks in a different tool, where the batch concept does not apply the same way.
- The error text names a different tool, stage, or root cause. Match the verbatim error first and use that skill.

## Steps
1. Read the observed count from the validation result and compare it with the min and max in the expectation configuration. Verify: the observed count and both bounds are known
2. Inspect the batch request and any runtime batch parameters or filters that limit which rows the validator loaded. Verify: the batch scope, including filters and sampling, is explicit
3. Count the full table and the filtered scope directly in the source to see which one matches the observed count. Verify: the observed count is matched to either the full table or the filtered scope
4. Fix the scope if it is wrong, or, if a genuine load dropped or duplicated rows, fix the loader and reload; only widen the bounds when the new volume is the expected steady state. Verify: the count and the bounds now describe the same scope
5. Rerun the expectation on a fresh batch and record the new observed count. Verify: the expectation passes with the count inside the range

## Variant phrasings
### expect_table_row_count_to_be_between observed value
The result-detail phrasing focused on the observed count.
### great expectations row count expectation batch filter
The batch-scope phrasing for filtered or partitioned batches.
### great expectations table row count too low after load
The load-failure phrasing, where the count drop is real.

Compatibility: Great Expectations 0.18 and 1.x, table-level expectations on any datasource

## Why it happens
The expectation knows nothing about the table, only about the batch it was handed. Batch filters, partition selection, sampling, and upstream load failures all change that count, so the same suite can pass in one environment and fail in another purely because the batch definition differs.

## Edge cases / pitfalls
- Row count bounds copied from a smaller environment fail after growth. Review bounds when volume changes materially.
- An exact zero usually means an empty partition or a failed load, not a threshold problem. Investigate before widening.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_JGA7FPOqjtftbWQA_bZaFQ
