Skip to content

test(cdk): add unit tests for SubstreamPartitionRouter null handling fix#891

Closed
darynaishchenko wants to merge 2 commits intodaryna/fix-substream-partition-routerfrom
devin/1770132818-unit-tests-for-pr-889
Closed

test(cdk): add unit tests for SubstreamPartitionRouter null handling fix#891
darynaishchenko wants to merge 2 commits intodaryna/fix-substream-partition-routerfrom
devin/1770132818-unit-tests-for-pr-889

Conversation

@darynaishchenko
Copy link
Contributor

@darynaishchenko darynaishchenko commented Feb 3, 2026

This PR targets the following PR:


Summary

This PR adds unit tests for the changes made in PR #889, which fixes SubstreamPartitionRouter updating cursor values when no records were read in a partition.

The tests cover:

  1. iterate_with_last_flag function - Parametrized test verifying the new sentinel yield behavior (None, True) for empty generators, plus existing behavior for non-empty iterables
  2. Empty partition handling - Test that when a partition has no records, no slices are yielded for that partition
  3. Empty parent partitions - Test that when a parent stream generates no partitions, stream_slices() returns early without errors

Review & Testing Checklist for Human

  • Verify test_iterate_with_last_flag[empty_generator_yields_none_sentinel] correctly validates the new sentinel yield behavior added in PR fix(cdk): fix SubstreamPartitionRouter updating cursor value when no records were read in partition #889
  • Confirm test_substream_partition_router_no_cursor_update_when_partition_has_no_records exercises the null-check logic for parent_record
  • Run the full test suite to ensure no regressions: poetry run pytest unit_tests/sources/declarative/partition_routers/test_substream_partition_router.py -v

Notes

devin-ai-integration bot and others added 2 commits February 3, 2026 16:39
…#883)

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: gl_anatolii.yatsuk@airbyte.io <gl_anatolii.yatsuk@airbyte.io>
…titionRouter null handling

Co-Authored-By: Daryna Ishchenko <darina.ishchenko17@gmail.com>
@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@devin-ai-integration
Copy link
Contributor

Closing this PR as the tests will be added directly to PR #889 as requested.

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

Successfully merging this pull request may close these issues.

1 participant