fix: allow _with_context tests to collect sample rows#981
fix: allow _with_context tests to collect sample rows#981
Conversation
Elementary-namespaced tests were early-returning from the test materialization, bypassing all sampling logic. _with_context tests behave like regular dbt tests (they return failing rows) so they should go through the standard handle_dbt_test sampling path. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
👋 @joostboon |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughUpdated the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…alization Instead of checking test name suffix, use the existing get_elementary_test_type macro to determine if an elementary-namespaced test handles its own result row collection. Only anomaly detection and schema change tests early-return; all other elementary tests (e.g. _with_context) go through the standard sampling path. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
_with_contexttests are Elementary-namespaced but behave like regular dbt tests (they return failing rows rather than handling their own result row collection)elementary-namespaced tests, bypassing the sampling logic entirely_with_contexttests never wrote rows totest_result_rows, even when tagged withshow_sample_rowsFix
Check if the test name ends with
_with_contextbefore early-returning, allowing these tests to go through the standardhandle_dbt_testsampling path.Test plan
_with_contexttest (e.g.not_null_with_context) and verify rows appear intest_result_rows_with_contextElementary tests (anomaly, schema change) still early-return and handle their own result rows🤖 Generated with Claude Code
Summary by CodeRabbit